Compare commits

..
19 Commits
Author SHA1 Message Date
Alug 48d9b2bc98 reduce netbuffer scope even further 2025-07-26 16:19:13 +02:00
Alug 939bf588b3 Merge branch 'Saturn-Next' into fixupnet 2025-07-26 16:19:09 +02:00
Alug b0653416f6 Merge branch 'Saturn-Next' into fixupnet 2025-07-20 17:03:30 +02:00
Alug d1a6394e52 Merge remote-tracking branch 'origin/Saturn-Next' into fixupnet 2025-06-19 15:55:22 +02:00
Alug ccc90842a7 move CopyCaretColors to m_misc 2025-06-12 17:10:08 +02:00
Alug dc069d7bb5 unnest HandlePacketFromPlayer
+ some cleanup
2025-06-12 00:53:47 +02:00
Alug f4a827dfc2 fix conflicts 2025-06-12 00:02:55 +02:00
Alug 4f3232b6cc Merge branch 'Saturn-Next' into fixupnet 2025-06-12 00:02:05 +02:00
Alug 3685502edf Revert "delet tic resending stuff"
This reverts commit 17bc8a4a36.
2025-05-26 18:10:03 +02:00
Alug f87bcef079 try fixing some crash with bogus netxcmds 2025-05-23 16:55:47 +02:00
Alug c3458afe2b unglobalise holepunchpacket aswell 2025-05-23 16:53:42 +02:00
Alug 17bc8a4a36 delet tic resending stuff 2025-05-23 16:51:26 +02:00
Alug b04f017ab6 change ticqueue system to be more like srb 2.2
mostly just renaming lel
2025-05-23 16:51:10 +02:00
Alug 083ddb6396 Refactor netbuffer out of global namespace
https://git.do.srb2.org/Hanicef/SRB2Classic/-/commit/079fd2cef97a9cf22fb5d2b66a9b500914efbc72

+ move some things into functions
2025-05-23 16:48:34 +02:00
Alug c3129742c3 simplify cmpack 2025-05-23 16:44:52 +02:00
Alug 877bd640f3 fix destinationnode check in Processackpak 2025-05-23 16:43:52 +02:00
Alug 3233df9c6c do not resolve ipv4 in curl when using ipv6 2025-05-23 16:43:24 +02:00
Alug 9ad5f5189c split portnum retrieval into own function 2025-05-23 16:43:02 +02:00
Alug c7718dea79 fixup! i_tcp
technically make ipv6 work,, but its disabled by default
2025-05-23 16:40:38 +02:00
47 changed files with 6672 additions and 10575 deletions

No files matched your search

-1
View File
@@ -324,7 +324,6 @@ static void AM_initVariables(void)
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
}
AM_changeWindowLoc();
// for saving & restoring
+833 -701
View File
File diff suppressed because it is too large. Load diff
+2 -3
View File
@@ -42,8 +42,8 @@ applications may follow different packet versions.
#define VANILLA_GT_MATCH 3
// Networking and tick handling related.
#define BACKUPTICS 32
#define TICQUEUE 512 // more than enough for most timeouts....
#define BACKUPTICS 512 // more than enough for most timeouts....
#define CLIENTBACKUPTICS 32
#define MAXTEXTCMD 256
// No. of tics your controls can be delayed by.
@@ -533,7 +533,6 @@ extern UINT32 serverlistultimatecount;
extern INT32 mapchangepending;
// Points inside doomcom
extern doomdata_t *netbuffer;
extern consvar_t cv_stunserver;
extern consvar_t cv_httpsource;
extern consvar_t cv_kicktime;
+2 -1
View File
@@ -898,13 +898,14 @@ void D_SRB2Loop(void)
rendertimefrac_unpaused = FRACUNIT;
}
if (interp || doDisplay)
{
if (!frameskip)
{
ranwipe = D_Display();
}
else if (!dedicated)
else if (frameskip)
{
// always update console and hud
// otherwise it may take minutes to open it
+34 -29
View File
@@ -48,12 +48,6 @@ tic_t connectiontimeout = (10*TICRATE);
/// \brief network packet
doomcom_t *doomcom = NULL;
/// \brief network packet data, points inside doomcom
doomdata_t *netbuffer = NULL;
/// \brief hole punching packet, also points inside doomcom
#ifdef HOLEPUNCH
holepunch_t *holepunchpacket = NULL;
#endif
#ifdef DEBUGFILE
FILE *debugfile = NULL; // put some net info in a file during the game
@@ -209,13 +203,9 @@ static node_t nodes[MAXNETNODES];
// 0 if a = n (mod 256)
// >0 if a > b (mod 256)
// mnemonic: to use it compare to 0: cmpack(a,b)<0 is "a < b" ...
FUNCMATH static INT32 cmpack(UINT8 a, UINT8 b)
FUNCMATH static inline INT32 cmpack(UINT8 a, UINT8 b)
{
register INT32 d = a - b;
if (d >= 127 || d < -128)
return -d;
return d;
return (SINT8)(a - b);
}
/** Sets freeack to a free acknum and copies the netbuffer in the ackpak table
@@ -229,6 +219,8 @@ static boolean GetFreeAcknum(UINT8 *freeack)
node_t *node = &nodes[doomcom->remotenode];
INT32 i, numfreeslot = 0;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
if (cmpack((UINT8)((node->remotefirstack + MAXACKTOSEND) % 256), node->nextacknum) < 0)
{
DEBFILE(va("too fast %d %d\n",node->remotefirstack,node->nextacknum));
@@ -298,6 +290,7 @@ static boolean Processackpak(void)
INT32 i;
boolean goodpacket = true;
node_t *node = &nodes[doomcom->remotenode];
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
// Received an ack return, so remove the ack in the list
if (netbuffer->ackreturn && cmpack(node->remotefirstack, netbuffer->ackreturn) < 0)
@@ -307,7 +300,7 @@ static boolean Processackpak(void)
// Search the ackbuffer and free it
for (i = 0; i < MAXACKPACKETS; i++)
{
if (ackpak[i].acknum && ackpak[i].destinationnode == node - nodes
if (ackpak[i].acknum && ackpak[i].destinationnode == doomcom->remotenode
&& cmpack(ackpak[i].acknum, netbuffer->ackreturn) <= 0)
{
RemoveAck(i);
@@ -423,6 +416,7 @@ void Net_SendAcks(INT32 node)
#ifdef NONET
(void)node;
#else
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
netbuffer->packettype = PT_NOTHING;
M_Memcpy(netbuffer->u.textcmd, nodes[node].acktosend, MAXACKTOSEND);
HSendPacket(node, false, 0, MAXACKTOSEND);
@@ -434,6 +428,8 @@ static void GotAcks(void)
{
INT32 i, j;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
for (j = 0; j < MAXACKTOSEND; j++)
{
if (netbuffer->u.textcmd[j])
@@ -487,6 +483,8 @@ void Net_AckTicker(void)
#ifndef NONET
INT32 i;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
for (i = 0; i < MAXACKPACKETS; i++)
{
const INT32 nodei = ackpak[i].destinationnode;
@@ -542,6 +540,7 @@ void Net_UnAcknowledgePacket(INT32 node)
#ifdef NONET
(void)node;
#else
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
INT32 hm1 = (nodes[node].acktosend_head-1+MAXACKTOSEND) % MAXACKTOSEND;
DEBFILE(va("UnAcknowledge node %d\n", node));
@@ -736,6 +735,7 @@ void Net_CloseConnection(INT32 node)
//
static UINT32 NetbufferChecksum(void)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
UINT32 c = 0x1234567;
const INT32 l = doomcom->datalength - 4;
const UINT8 *buf = (UINT8 *)netbuffer + 4;
@@ -852,6 +852,8 @@ const char *Net_GetPacketName(UINT8 packettype)
static void DebugPrintpacket(const char *header)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
fprintf(debugfile, "%-12s (node %d,ack %d,ackret %d,size %d) type(%d) : %s\n",
header, doomcom->remotenode, netbuffer->ack, netbuffer->ackreturn, doomcom->datalength,
netbuffer->packettype, Net_GetPacketName(netbuffer->packettype));
@@ -1021,6 +1023,7 @@ void Command_Droprate(void)
#ifndef NONET
static boolean ShouldDropPacket(void)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
return (packetdropquantity[netbuffer->packettype])
|| (packetdroprate != 0 && rand() < (((double)RAND_MAX) * (packetdroprate / 100.f))) || packetdroprate == 100;
}
@@ -1032,6 +1035,7 @@ static boolean ShouldDropPacket(void)
//
boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlength)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
doomcom->datalength = (INT16)(packetlength + BASEPACKETSIZE);
if (node == 0) // Packet is to go back to us
@@ -1132,7 +1136,7 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
//
boolean HGetPacket(void)
{
//boolean nodejustjoined;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
// Get a packet from self
if (rebound_tail != rebound_head)
@@ -1220,6 +1224,18 @@ static void Internal_FreeNodenum(INT32 nodenum)
(void)nodenum;
}
static char *I_NetSplitAddress(char *host, char **port)
{
boolean v4 = (host[0] != '[');
host = strtok(host, v4 ? ":" : "[]");
if (port)
*port = strtok(NULL, ":");
return host;
}
SINT8 I_NetMakeNode(const char *hostname)
{
SINT8 newnode = -1;
@@ -1227,20 +1243,14 @@ SINT8 I_NetMakeNode(const char *hostname)
if (I_NetMakeNodewPort)
{
char *localhostname = strdup(hostname);
char *t = localhostname;
const char *port;
char *port;
if (!localhostname)
return newnode;
// retrieve portnum from address!
strtok(localhostname, ":");
port = strtok(NULL, ":");
hostname = I_NetSplitAddress(localhostname, &port);
// remove the port in the hostname as we've it already
while ((*t != ':') && (*t != '\0'))
t++;
*t = '\0';
newnode = I_NetMakeNodewPort(localhostname, port);
newnode = I_NetMakeNodewPort(hostname, port);
free(localhostname);
}
return newnode;
@@ -1332,11 +1342,6 @@ boolean D_CheckNetGame(void)
if (doomcom->numnodes > MAXNETNODES)
I_Error("Too many nodes (%d), max:%d", doomcom->numnodes, MAXNETNODES);
netbuffer = (doomdata_t *)(void *)&doomcom->data;
#ifdef HOLEPUNCH
holepunchpacket = (holepunch_t *)(void *)&doomcom->data;
#endif
#ifdef DEBUGFILE
if (M_CheckParm("-debugfile"))
{
+2 -6
View File
@@ -2110,18 +2110,14 @@ INT32 D_LookupPlayer(const char *s)
static INT32 FindPlayerByPlace(INT32 place)
{
INT32 playernum;
for (playernum = 0; playernum < MAXPLAYERS; ++playernum)
if (playeringame[playernum])
{
if (!playeringame[playernum])
continue;
if (players[playernum].kartstuff[k_position] == place)
{
return playernum;
}
}
return -1;
}
@@ -5678,7 +5674,7 @@ static void Command_Archivetest_f(void)
// assign mobjnum
i = 1;
for (th = thinkercap.next; th != &thinkercap; th = th->next)
if (th->function == (actionf_p1)P_MobjThinker)
if (th->function.acp1 == (actionf_p1)P_MobjThinker)
((mobj_t *)th)->mobjnum = i++;
// allocate buffer
+6
View File
@@ -142,6 +142,7 @@ UINT8 *PutFileNeeded(UINT16 firstfile)
{
size_t i;
UINT8 count = 0;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
UINT8 *p_start = netbuffer->packettype == PT_MOREFILESNEEDED ? netbuffer->u.filesneededcfg.files : netbuffer->u.serverinfo.fileneeded;
UINT8 *p = p_start;
char wadfilename[MAX_WADPATH] = "";
@@ -323,6 +324,7 @@ boolean CL_SendRequestFile(void)
#ifdef MORELEGACYDOWNLOADER
boolean firstloop = true;
#endif
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
#ifdef PARANOIA
if (M_CheckParm("-nodownload"))
@@ -451,9 +453,11 @@ tryagain:
// returns false if a requested file was not found or cannot be sent
boolean Got_RequestFilePak(INT32 node)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
char wad[MAX_WADPATH+1];
UINT8 *p = netbuffer->u.textcmd;
UINT8 id;
while (p < netbuffer->u.textcmd + MAXTEXTCMD) // Don't allow hacked client to overflow
{
id = READUINT8(p);
@@ -817,6 +821,7 @@ void SV_FileSendTicker(void)
size_t size;
filetx_t *f;
INT32 packetsent, ram, i, j;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
if (!filestosend) // No file to send
return;
@@ -945,6 +950,7 @@ void SV_FileSendTicker(void)
void Got_Filetxpak(void)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
INT32 filenum = netbuffer->u.filetxpak.fileid;
fileneeded_t *file = &fileneeded[filenum];
char *filename = file->filename;
+8 -1
View File
@@ -28,11 +28,18 @@
// To compile this as "ANSI C with classes" we will need to handle the various
// action functions cleanly.
//
typedef void (*actionf_v)();
typedef void (*actionf_p1)(void *);
typedef union
{
actionf_v acv;
actionf_p1 acp1;
} actionf_t;
// Historically, "think_t" is yet another function pointer to a routine
// to handle an actor.
typedef actionf_p1 think_t;
typedef actionf_t think_t;
// Doubly linked list of actors.
typedef struct thinker_s
-5
View File
@@ -152,8 +152,3 @@ boolean I_UseNativeKeyboard(void)
{
return false;
}
void I_SetBorderlessWindow(void)
{
}
+217 -218
View File
@@ -1416,212 +1416,211 @@ static void readhuditem(MYFILE *f, INT32 num)
// DO NOT FORGET TO SYNC THIS LIST WITH THE ACTIONNUM ENUM IN INFO.H
actionpointer_t actionpointers[] =
{
{A_Explode, "A_EXPLODE"},
{A_Pain, "A_PAIN"},
{A_Fall, "A_FALL"},
{A_MonitorPop, "A_MONITORPOP"},
{A_Look, "A_LOOK"},
{A_Chase, "A_CHASE"},
{A_FaceStabChase, "A_FACESTABCHASE"},
{A_FaceTarget, "A_FACETARGET"},
{A_FaceTracer, "A_FACETRACER"},
{A_Scream, "A_SCREAM"},
{A_BossDeath, "A_BOSSDEATH"},
{A_CustomPower, "A_CUSTOMPOWER"},
{A_GiveWeapon, "A_GIVEWEAPON"},
{A_RingShield, "A_RINGSHIELD"},
{A_RingBox, "A_RINGBOX"},
{A_Invincibility, "A_INVINCIBILITY"},
{A_SuperSneakers, "A_SUPERSNEAKERS"},
{A_BunnyHop, "A_BUNNYHOP"},
{A_BubbleSpawn, "A_BUBBLESPAWN"},
{A_FanBubbleSpawn, "A_FANBUBBLESPAWN"},
{A_BubbleRise, "A_BUBBLERISE"},
{A_BubbleCheck, "A_BUBBLECHECK"},
{A_AwardScore, "A_AWARDSCORE"},
{A_ExtraLife, "A_EXTRALIFE"},
{A_BombShield, "A_BOMBSHIELD"},
{A_JumpShield, "A_JUMPSHIELD"},
{A_WaterShield, "A_WATERSHIELD"},
{A_ForceShield, "A_FORCESHIELD"},
{A_PityShield, "A_PITYSHIELD"},
{A_GravityBox, "A_GRAVITYBOX"},
{A_ScoreRise, "A_SCORERISE"},
{A_ParticleSpawn, "A_PARTICLESPAWN"},
{A_AttractChase, "A_ATTRACTCHASE"},
{A_DropMine, "A_DROPMINE"},
{A_FishJump, "A_FISHJUMP"},
{A_ThrownRing, "A_THROWNRING"},
{A_GrenadeRing, "A_GRENADERING"}, // SRB2kart
{A_SetSolidSteam, "A_SETSOLIDSTEAM"},
{A_UnsetSolidSteam, "A_UNSETSOLIDSTEAM"},
{A_SignPlayer, "A_SIGNPLAYER"},
{A_OverlayThink, "A_OVERLAYTHINK"},
{A_JetChase, "A_JETCHASE"},
{A_JetbThink, "A_JETBTHINK"},
{A_JetgThink, "A_JETGTHINK"},
{A_JetgShoot, "A_JETGSHOOT"},
{A_ShootBullet, "A_SHOOTBULLET"},
{A_MinusDigging, "A_MINUSDIGGING"},
{A_MinusPopup, "A_MINUSPOPUP"},
{A_MinusCheck, "A_MINUSCHECK"},
{A_ChickenCheck, "A_CHICKENCHECK"},
{A_MouseThink, "A_MOUSETHINK"},
{A_DetonChase, "A_DETONCHASE"},
{A_CapeChase, "A_CAPECHASE"},
{A_RotateSpikeBall, "A_ROTATESPIKEBALL"},
{A_SlingAppear, "A_SLINGAPPEAR"},
{A_MaceRotate, "A_MACEROTATE"},
{A_UnidusBall, "A_UNIDUSBALL"},
{A_RockSpawn, "A_ROCKSPAWN"},
{A_SetFuse, "A_SETFUSE"},
{A_CrawlaCommanderThink, "A_CRAWLACOMMANDERTHINK"},
{A_SmokeTrailer, "A_SMOKETRAILER"},
{A_RingExplode, "A_RINGEXPLODE"},
{A_OldRingExplode, "A_OLDRINGEXPLODE"},
{A_MixUp, "A_MIXUP"},
{A_RecyclePowers, "A_RECYCLEPOWERS"},
{A_Boss1Chase, "A_BOSS1CHASE"},
{A_FocusTarget, "A_FOCUSTARGET"},
{A_Boss2Chase, "A_BOSS2CHASE"},
{A_Boss2Pogo, "A_BOSS2POGO"},
{A_BossZoom, "A_BOSSZOOM"},
{A_BossScream, "A_BOSSSCREAM"},
{A_Boss2TakeDamage, "A_BOSS2TAKEDAMAGE"},
{A_Boss7Chase, "A_BOSS7CHASE"},
{A_GoopSplat, "A_GOOPSPLAT"},
{A_Boss2PogoSFX, "A_BOSS2POGOSFX"},
{A_Boss2PogoTarget, "A_BOSS2POGOTARGET"},
{A_BossJetFume, "A_BOSSJETFUME"},
{A_EggmanBox, "A_EGGMANBOX"},
{A_TurretFire, "A_TURRETFIRE"},
{A_SuperTurretFire, "A_SUPERTURRETFIRE"},
{A_TurretStop, "A_TURRETSTOP"},
{A_JetJawRoam, "A_JETJAWROAM"},
{A_JetJawChomp, "A_JETJAWCHOMP"},
{A_PointyThink, "A_POINTYTHINK"},
{A_CheckBuddy, "A_CHECKBUDDY"},
{A_HoodThink, "A_HOODTHINK"},
{A_ArrowCheck, "A_ARROWCHECK"},
{A_SnailerThink, "A_SNAILERTHINK"},
{A_SharpChase, "A_SHARPCHASE"},
{A_SharpSpin, "A_SHARPSPIN"},
{A_VultureVtol, "A_VULTUREVTOL"},
{A_VultureCheck, "A_VULTURECHECK"},
{A_SkimChase, "A_SKIMCHASE"},
{A_1upThinker, "A_1UPTHINKER"},
{A_SkullAttack, "A_SKULLATTACK"},
{A_LobShot, "A_LOBSHOT"},
{A_FireShot, "A_FIRESHOT"},
{A_SuperFireShot, "A_SUPERFIRESHOT"},
{A_BossFireShot, "A_BOSSFIRESHOT"},
{A_Boss7FireMissiles, "A_BOSS7FIREMISSILES"},
{A_Boss1Laser, "A_BOSS1LASER"},
{A_Boss4Reverse, "A_BOSS4REVERSE"},
{A_Boss4SpeedUp, "A_BOSS4SPEEDUP"},
{A_Boss4Raise, "A_BOSS4RAISE"},
{A_SparkFollow, "A_SPARKFOLLOW"},
{A_BuzzFly, "A_BUZZFLY"},
{A_GuardChase, "A_GUARDCHASE"},
{A_EggShield, "A_EGGSHIELD"},
{A_SetReactionTime, "A_SETREACTIONTIME"},
{A_Boss1Spikeballs, "A_BOSS1SPIKEBALLS"},
{A_Boss3TakeDamage, "A_BOSS3TAKEDAMAGE"},
{A_Boss3Path, "A_BOSS3PATH"},
{A_LinedefExecute, "A_LINEDEFEXECUTE"},
{A_PlaySeeSound, "A_PLAYSEESOUND"},
{A_PlayAttackSound, "A_PLAYATTACKSOUND"},
{A_PlayActiveSound, "A_PLAYACTIVESOUND"},
{A_SpawnObjectAbsolute, "A_SPAWNOBJECTABSOLUTE"},
{A_SpawnObjectRelative, "A_SPAWNOBJECTRELATIVE"},
{A_ChangeAngleRelative, "A_CHANGEANGLERELATIVE"},
{A_ChangeAngleAbsolute, "A_CHANGEANGLEABSOLUTE"},
{A_PlaySound, "A_PLAYSOUND"},
{A_FindTarget, "A_FINDTARGET"},
{A_FindTracer, "A_FINDTRACER"},
{A_SetTics, "A_SETTICS"},
{A_SetRandomTics, "A_SETRANDOMTICS"},
{A_ChangeColorRelative, "A_CHANGECOLORRELATIVE"},
{A_ChangeColorAbsolute, "A_CHANGECOLORABSOLUTE"},
{A_MoveRelative, "A_MOVERELATIVE"},
{A_MoveAbsolute, "A_MOVEABSOLUTE"},
{A_Thrust, "A_THRUST"},
{A_ZThrust, "A_ZTHRUST"},
{A_SetTargetsTarget, "A_SETTARGETSTARGET"},
{A_SetObjectFlags, "A_SETOBJECTFLAGS"},
{A_SetObjectFlags2, "A_SETOBJECTFLAGS2"},
{A_RandomState, "A_RANDOMSTATE"},
{A_RandomStateRange, "A_RANDOMSTATERANGE"},
{A_DualAction, "A_DUALACTION"},
{A_RemoteAction, "A_REMOTEACTION"},
{A_ToggleFlameJet, "A_TOGGLEFLAMEJET"},
{A_ItemPop, "A_ITEMPOP"}, // SRB2kart
{A_JawzChase, "A_JAWZCHASE"}, // SRB2kart
{A_JawzExplode, "A_JAWZEXPLODE"}, // SRB2kart
{A_SPBChase, "A_SPBCHASE"}, // SRB2kart
{A_MineExplode, "A_MINEEXPLODE"}, // SRB2kart
{A_BallhogExplode, "A_BALLHOGEXPLODE"}, // SRB2kart
{A_LightningFollowPlayer,"A_LIGHTNINGFOLLOWPLAYER"}, //SRB2kart
{A_FZBoomFlash, "A_FZBOOMFLASH"}, //SRB2kart
{A_FZBoomSmoke, "A_FZBOOMSMOKE"}, //SRB2kart
{A_RandomShadowFrame, "A_RANDOMSHADOWFRAME"}, //SRB2kart
{A_RoamingShadowThinker, "A_ROAMINGSHADOWTHINKER"}, //SRB2kart
{A_MayonakaArrow, "A_MAYONAKAARROW"}, //SRB2kart
{A_ReaperThinker, "A_REAPERTHINKER"}, //SRB2kart
{A_MementosTPParticles, "A_MEMENTOSTPPARTICLES"}, //SRB2kart
{A_FlameParticle, "A_FLAMEPARTICLE"}, // SRB2kart
{A_OrbitNights, "A_ORBITNIGHTS"},
{A_GhostMe, "A_GHOSTME"},
{A_SetObjectState, "A_SETOBJECTSTATE"},
{A_SetObjectTypeState, "A_SETOBJECTTYPESTATE"},
{A_KnockBack, "A_KNOCKBACK"},
{A_PushAway, "A_PUSHAWAY"},
{A_RingDrain, "A_RINGDRAIN"},
{A_SplitShot, "A_SPLITSHOT"},
{A_MissileSplit, "A_MISSILESPLIT"},
{A_MultiShot, "A_MULTISHOT"},
{A_InstaLoop, "A_INSTALOOP"},
{A_Custom3DRotate, "A_CUSTOM3DROTATE"},
{A_SearchForPlayers, "A_SEARCHFORPLAYERS"},
{A_CheckRandom, "A_CHECKRANDOM"},
{A_CheckTargetRings, "A_CHECKTARGETRINGS"},
{A_CheckRings, "A_CHECKRINGS"},
{A_CheckTotalRings, "A_CHECKTOTALRINGS"},
{A_CheckHealth, "A_CHECKHEALTH"},
{A_CheckRange, "A_CHECKRANGE"},
{A_CheckHeight, "A_CHECKHEIGHT"},
{A_CheckTrueRange, "A_CHECKTRUERANGE"},
{A_CheckThingCount, "A_CHECKTHINGCOUNT"},
{A_CheckAmbush, "A_CHECKAMBUSH"},
{A_CheckCustomValue, "A_CHECKCUSTOMVALUE"},
{A_CheckCusValMemo, "A_CHECKCUSVALMEMO"},
{A_SetCustomValue, "A_SETCUSTOMVALUE"},
{A_UseCusValMemo, "A_USECUSVALMEMO"},
{A_RelayCustomValue, "A_RELAYCUSTOMVALUE"},
{A_CusValAction, "A_CUSVALACTION"},
{A_ForceStop, "A_FORCESTOP"},
{A_ForceWin, "A_FORCEWIN"},
{A_SpikeRetract, "A_SPIKERETRACT"},
{A_InfoState, "A_INFOSTATE"},
{A_Repeat, "A_REPEAT"},
{A_SetScale, "A_SETSCALE"},
{A_RemoteDamage, "A_REMOTEDAMAGE"},
{A_HomingChase, "A_HOMINGCHASE"},
{A_TrapShot, "A_TRAPSHOT"},
{A_VileTarget, "A_VILETARGET"},
{A_VileAttack, "A_VILEATTACK"},
{A_VileFire, "A_VILEFIRE"},
{A_BrakChase, "A_BRAKCHASE"},
{A_BrakFireShot, "A_BRAKFIRESHOT"},
{A_BrakLobShot, "A_BRAKLOBSHOT"},
{A_NapalmScatter, "A_NAPALMSCATTER"},
{A_SpawnFreshCopy, "A_SPAWNFRESHCOPY"},
//{A_InvincSparkleRotate, "A_INVINCSPARKLEROTATE"},
{{A_Explode}, "A_EXPLODE"},
{{A_Pain}, "A_PAIN"},
{{A_Fall}, "A_FALL"},
{{A_MonitorPop}, "A_MONITORPOP"},
{{A_Look}, "A_LOOK"},
{{A_Chase}, "A_CHASE"},
{{A_FaceStabChase}, "A_FACESTABCHASE"},
{{A_FaceTarget}, "A_FACETARGET"},
{{A_FaceTracer}, "A_FACETRACER"},
{{A_Scream}, "A_SCREAM"},
{{A_BossDeath}, "A_BOSSDEATH"},
{{A_CustomPower}, "A_CUSTOMPOWER"},
{{A_GiveWeapon}, "A_GIVEWEAPON"},
{{A_RingShield}, "A_RINGSHIELD"},
{{A_RingBox}, "A_RINGBOX"},
{{A_Invincibility}, "A_INVINCIBILITY"},
{{A_SuperSneakers}, "A_SUPERSNEAKERS"},
{{A_BunnyHop}, "A_BUNNYHOP"},
{{A_BubbleSpawn}, "A_BUBBLESPAWN"},
{{A_FanBubbleSpawn}, "A_FANBUBBLESPAWN"},
{{A_BubbleRise}, "A_BUBBLERISE"},
{{A_BubbleCheck}, "A_BUBBLECHECK"},
{{A_AwardScore}, "A_AWARDSCORE"},
{{A_ExtraLife}, "A_EXTRALIFE"},
{{A_BombShield}, "A_BOMBSHIELD"},
{{A_JumpShield}, "A_JUMPSHIELD"},
{{A_WaterShield}, "A_WATERSHIELD"},
{{A_ForceShield}, "A_FORCESHIELD"},
{{A_PityShield}, "A_PITYSHIELD"},
{{A_GravityBox}, "A_GRAVITYBOX"},
{{A_ScoreRise}, "A_SCORERISE"},
{{A_ParticleSpawn}, "A_PARTICLESPAWN"},
{{A_AttractChase}, "A_ATTRACTCHASE"},
{{A_DropMine}, "A_DROPMINE"},
{{A_FishJump}, "A_FISHJUMP"},
{{A_ThrownRing}, "A_THROWNRING"},
{{A_GrenadeRing}, "A_GRENADERING"}, // SRB2kart
{{A_SetSolidSteam}, "A_SETSOLIDSTEAM"},
{{A_UnsetSolidSteam}, "A_UNSETSOLIDSTEAM"},
{{A_SignPlayer}, "A_SIGNPLAYER"},
{{A_OverlayThink}, "A_OVERLAYTHINK"},
{{A_JetChase}, "A_JETCHASE"},
{{A_JetbThink}, "A_JETBTHINK"},
{{A_JetgThink}, "A_JETGTHINK"},
{{A_JetgShoot}, "A_JETGSHOOT"},
{{A_ShootBullet}, "A_SHOOTBULLET"},
{{A_MinusDigging}, "A_MINUSDIGGING"},
{{A_MinusPopup}, "A_MINUSPOPUP"},
{{A_MinusCheck}, "A_MINUSCHECK"},
{{A_ChickenCheck}, "A_CHICKENCHECK"},
{{A_MouseThink}, "A_MOUSETHINK"},
{{A_DetonChase}, "A_DETONCHASE"},
{{A_CapeChase}, "A_CAPECHASE"},
{{A_RotateSpikeBall}, "A_ROTATESPIKEBALL"},
{{A_SlingAppear}, "A_SLINGAPPEAR"},
{{A_MaceRotate}, "A_MACEROTATE"},
{{A_UnidusBall}, "A_UNIDUSBALL"},
{{A_RockSpawn}, "A_ROCKSPAWN"},
{{A_SetFuse}, "A_SETFUSE"},
{{A_CrawlaCommanderThink}, "A_CRAWLACOMMANDERTHINK"},
{{A_SmokeTrailer}, "A_SMOKETRAILER"},
{{A_RingExplode}, "A_RINGEXPLODE"},
{{A_OldRingExplode}, "A_OLDRINGEXPLODE"},
{{A_MixUp}, "A_MIXUP"},
{{A_RecyclePowers}, "A_RECYCLEPOWERS"},
{{A_Boss1Chase}, "A_BOSS1CHASE"},
{{A_FocusTarget}, "A_FOCUSTARGET"},
{{A_Boss2Chase}, "A_BOSS2CHASE"},
{{A_Boss2Pogo}, "A_BOSS2POGO"},
{{A_BossZoom}, "A_BOSSZOOM"},
{{A_BossScream}, "A_BOSSSCREAM"},
{{A_Boss2TakeDamage}, "A_BOSS2TAKEDAMAGE"},
{{A_Boss7Chase}, "A_BOSS7CHASE"},
{{A_GoopSplat}, "A_GOOPSPLAT"},
{{A_Boss2PogoSFX}, "A_BOSS2POGOSFX"},
{{A_Boss2PogoTarget}, "A_BOSS2POGOTARGET"},
{{A_BossJetFume}, "A_BOSSJETFUME"},
{{A_EggmanBox}, "A_EGGMANBOX"},
{{A_TurretFire}, "A_TURRETFIRE"},
{{A_SuperTurretFire}, "A_SUPERTURRETFIRE"},
{{A_TurretStop}, "A_TURRETSTOP"},
{{A_JetJawRoam}, "A_JETJAWROAM"},
{{A_JetJawChomp}, "A_JETJAWCHOMP"},
{{A_PointyThink}, "A_POINTYTHINK"},
{{A_CheckBuddy}, "A_CHECKBUDDY"},
{{A_HoodThink}, "A_HOODTHINK"},
{{A_ArrowCheck}, "A_ARROWCHECK"},
{{A_SnailerThink}, "A_SNAILERTHINK"},
{{A_SharpChase}, "A_SHARPCHASE"},
{{A_SharpSpin}, "A_SHARPSPIN"},
{{A_VultureVtol}, "A_VULTUREVTOL"},
{{A_VultureCheck}, "A_VULTURECHECK"},
{{A_SkimChase}, "A_SKIMCHASE"},
{{A_1upThinker}, "A_1UPTHINKER"},
{{A_SkullAttack}, "A_SKULLATTACK"},
{{A_LobShot}, "A_LOBSHOT"},
{{A_FireShot}, "A_FIRESHOT"},
{{A_SuperFireShot}, "A_SUPERFIRESHOT"},
{{A_BossFireShot}, "A_BOSSFIRESHOT"},
{{A_Boss7FireMissiles}, "A_BOSS7FIREMISSILES"},
{{A_Boss1Laser}, "A_BOSS1LASER"},
{{A_Boss4Reverse}, "A_BOSS4REVERSE"},
{{A_Boss4SpeedUp}, "A_BOSS4SPEEDUP"},
{{A_Boss4Raise}, "A_BOSS4RAISE"},
{{A_SparkFollow}, "A_SPARKFOLLOW"},
{{A_BuzzFly}, "A_BUZZFLY"},
{{A_GuardChase}, "A_GUARDCHASE"},
{{A_EggShield}, "A_EGGSHIELD"},
{{A_SetReactionTime}, "A_SETREACTIONTIME"},
{{A_Boss1Spikeballs}, "A_BOSS1SPIKEBALLS"},
{{A_Boss3TakeDamage}, "A_BOSS3TAKEDAMAGE"},
{{A_Boss3Path}, "A_BOSS3PATH"},
{{A_LinedefExecute}, "A_LINEDEFEXECUTE"},
{{A_PlaySeeSound}, "A_PLAYSEESOUND"},
{{A_PlayAttackSound}, "A_PLAYATTACKSOUND"},
{{A_PlayActiveSound}, "A_PLAYACTIVESOUND"},
{{A_SpawnObjectAbsolute}, "A_SPAWNOBJECTABSOLUTE"},
{{A_SpawnObjectRelative}, "A_SPAWNOBJECTRELATIVE"},
{{A_ChangeAngleRelative}, "A_CHANGEANGLERELATIVE"},
{{A_ChangeAngleAbsolute}, "A_CHANGEANGLEABSOLUTE"},
{{A_PlaySound}, "A_PLAYSOUND"},
{{A_FindTarget}, "A_FINDTARGET"},
{{A_FindTracer}, "A_FINDTRACER"},
{{A_SetTics}, "A_SETTICS"},
{{A_SetRandomTics}, "A_SETRANDOMTICS"},
{{A_ChangeColorRelative}, "A_CHANGECOLORRELATIVE"},
{{A_ChangeColorAbsolute}, "A_CHANGECOLORABSOLUTE"},
{{A_MoveRelative}, "A_MOVERELATIVE"},
{{A_MoveAbsolute}, "A_MOVEABSOLUTE"},
{{A_Thrust}, "A_THRUST"},
{{A_ZThrust}, "A_ZTHRUST"},
{{A_SetTargetsTarget}, "A_SETTARGETSTARGET"},
{{A_SetObjectFlags}, "A_SETOBJECTFLAGS"},
{{A_SetObjectFlags2}, "A_SETOBJECTFLAGS2"},
{{A_RandomState}, "A_RANDOMSTATE"},
{{A_RandomStateRange}, "A_RANDOMSTATERANGE"},
{{A_DualAction}, "A_DUALACTION"},
{{A_RemoteAction}, "A_REMOTEACTION"},
{{A_ToggleFlameJet}, "A_TOGGLEFLAMEJET"},
{{A_ItemPop}, "A_ITEMPOP"}, // SRB2kart
{{A_JawzChase}, "A_JAWZCHASE"}, // SRB2kart
{{A_JawzExplode}, "A_JAWZEXPLODE"}, // SRB2kart
{{A_SPBChase}, "A_SPBCHASE"}, // SRB2kart
{{A_MineExplode}, "A_MINEEXPLODE"}, // SRB2kart
{{A_BallhogExplode}, "A_BALLHOGEXPLODE"}, // SRB2kart
{{A_LightningFollowPlayer},"A_LIGHTNINGFOLLOWPLAYER"}, //SRB2kart
{{A_FZBoomFlash}, "A_FZBOOMFLASH"}, //SRB2kart
{{A_FZBoomSmoke}, "A_FZBOOMSMOKE"}, //SRB2kart
{{A_RandomShadowFrame}, "A_RANDOMSHADOWFRAME"}, //SRB2kart
{{A_RoamingShadowThinker}, "A_ROAMINGSHADOWTHINKER"}, //SRB2kart
{{A_MayonakaArrow}, "A_MAYONAKAARROW"}, //SRB2kart
{{A_ReaperThinker}, "A_REAPERTHINKER"}, //SRB2kart
{{A_MementosTPParticles}, "A_MEMENTOSTPPARTICLES"}, //SRB2kart
{{A_FlameParticle}, "A_FLAMEPARTICLE"}, // SRB2kart
{{A_OrbitNights}, "A_ORBITNIGHTS"},
{{A_GhostMe}, "A_GHOSTME"},
{{A_SetObjectState}, "A_SETOBJECTSTATE"},
{{A_SetObjectTypeState}, "A_SETOBJECTTYPESTATE"},
{{A_KnockBack}, "A_KNOCKBACK"},
{{A_PushAway}, "A_PUSHAWAY"},
{{A_RingDrain}, "A_RINGDRAIN"},
{{A_SplitShot}, "A_SPLITSHOT"},
{{A_MissileSplit}, "A_MISSILESPLIT"},
{{A_MultiShot}, "A_MULTISHOT"},
{{A_InstaLoop}, "A_INSTALOOP"},
{{A_Custom3DRotate}, "A_CUSTOM3DROTATE"},
{{A_SearchForPlayers}, "A_SEARCHFORPLAYERS"},
{{A_CheckRandom}, "A_CHECKRANDOM"},
{{A_CheckTargetRings}, "A_CHECKTARGETRINGS"},
{{A_CheckRings}, "A_CHECKRINGS"},
{{A_CheckTotalRings}, "A_CHECKTOTALRINGS"},
{{A_CheckHealth}, "A_CHECKHEALTH"},
{{A_CheckRange}, "A_CHECKRANGE"},
{{A_CheckHeight}, "A_CHECKHEIGHT"},
{{A_CheckTrueRange}, "A_CHECKTRUERANGE"},
{{A_CheckThingCount}, "A_CHECKTHINGCOUNT"},
{{A_CheckAmbush}, "A_CHECKAMBUSH"},
{{A_CheckCustomValue}, "A_CHECKCUSTOMVALUE"},
{{A_CheckCusValMemo}, "A_CHECKCUSVALMEMO"},
{{A_SetCustomValue}, "A_SETCUSTOMVALUE"},
{{A_UseCusValMemo}, "A_USECUSVALMEMO"},
{{A_RelayCustomValue}, "A_RELAYCUSTOMVALUE"},
{{A_CusValAction}, "A_CUSVALACTION"},
{{A_ForceStop}, "A_FORCESTOP"},
{{A_ForceWin}, "A_FORCEWIN"},
{{A_SpikeRetract}, "A_SPIKERETRACT"},
{{A_InfoState}, "A_INFOSTATE"},
{{A_Repeat}, "A_REPEAT"},
{{A_SetScale}, "A_SETSCALE"},
{{A_RemoteDamage}, "A_REMOTEDAMAGE"},
{{A_HomingChase}, "A_HOMINGCHASE"},
{{A_TrapShot}, "A_TRAPSHOT"},
{{A_VileTarget}, "A_VILETARGET"},
{{A_VileAttack}, "A_VILEATTACK"},
{{A_VileFire}, "A_VILEFIRE"},
{{A_BrakChase}, "A_BRAKCHASE"},
{{A_BrakFireShot}, "A_BRAKFIRESHOT"},
{{A_BrakLobShot}, "A_BRAKLOBSHOT"},
{{A_NapalmScatter}, "A_NAPALMSCATTER"},
{{A_SpawnFreshCopy}, "A_SPAWNFRESHCOPY"},
{NULL, "NONE"},
{{NULL}, "NONE"},
// This NULL entry must be the last in the list
{NULL, NULL},
{{NULL}, NULL},
};
static void readframe(MYFILE *f, INT32 num)
@@ -1703,7 +1702,7 @@ static void readframe(MYFILE *f, INT32 num)
for (z = 0; actionpointers[z].name; z++)
{
if (actionpointers[z].action == states[num].action)
if (actionpointers[z].action.acv == states[num].action.acv)
{
break;
}
@@ -1712,17 +1711,17 @@ static void readframe(MYFILE *f, INT32 num)
z = 0;
found = LUA_SetLuaAction(&states[num], actiontocompare);
if (!found)
while (actionpointers[z].name)
{
while (actionpointers[z].name)
if (fastcmp(actiontocompare, actionpointers[z].name))
{
if (fastcmp(actiontocompare, actionpointers[z].name))
{
states[num].action = actionpointers[z].action;
found = true;
break;
}
z++;
states[num].action = actionpointers[z].action;
states[num].action.acv = actionpointers[z].action.acv; // assign
states[num].action.acp1 = actionpointers[z].action.acp1;
found = true;
break;
}
z++;
}
if (!found)
@@ -8525,13 +8524,13 @@ static inline int lib_freeslot(lua_State *L)
// Arguments: mobj_t actor, int var1, int var2
static inline int lib_action(lua_State *L)
{
actionf_p1 *action = lua_touserdata(L,lua_upvalueindex(1));
actionf_t *action = lua_touserdata(L,lua_upvalueindex(1));
mobj_t *actor = *((mobj_t **)luaL_checkudata(L,1,META_MOBJ));
var1 = (INT32)luaL_optinteger(L,2,0);
var2 = (INT32)luaL_optinteger(L,3,0);
if (!actor)
return LUA_ErrInvalid(L, "mobj_t");
(*action)(actor);
action->acp1(actor);
return 0;
}
@@ -9345,15 +9344,13 @@ int LUA_SOCLib(lua_State *L)
const char *LUA_GetActionName(void *action)
{
actionf_p1 *act = (actionf_p1 *)action;
actionf_t *act = (actionf_t *)action;
size_t z;
for (z = 0; actionpointers[z].name; z++)
{
if (actionpointers[z].action == *act)
if (actionpointers[z].action.acv == act->acv)
return actionpointers[z].name;
}
return NULL;
}
@@ -9366,6 +9363,8 @@ void LUA_SetActionByName(void *state, const char *actiontocompare)
if (fasticmp(actiontocompare, actionpointers[z].name))
{
st->action = actionpointers[z].action;
st->action.acv = actionpointers[z].action.acv; // assign
st->action.acp1 = actionpointers[z].action.acp1;
return;
}
}
+2 -2
View File
@@ -111,8 +111,8 @@ extern char logfilename[1024];
#else
#define VERSION 1 // Game version
#define SUBVERSION 6 // more precise version number
#define VERSIONSTRING "Saturn v8.3"
#define VERSIONSTRINGW L"Saturn v8.3"
#define VERSIONSTRING "Saturn v8.2"
#define VERSIONSTRINGW L"Saturn v8.2"
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
// And change CMakeLists.txt (not src/, but in root), for CMake users!
// AND appveyor.yml, for the build bots!
+1 -1
View File
@@ -575,7 +575,7 @@ extern consvar_t cv_downloading; // allow clients to downloading WADs.
extern consvar_t cv_nettimeout; // SRB2Kart: Advanced server options menu
extern consvar_t cv_jointimeout;
extern consvar_t cv_maxping;
extern ticcmd_t netcmds[TICQUEUE][MAXPLAYERS];
extern ticcmd_t netcmds[BACKUPTICS][MAXPLAYERS];
extern INT32 serverplayer;
extern INT32 adminplayers[MAXPLAYERS];
+3 -3941
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -792,7 +792,7 @@ static void HWR_PrecacheLevelSprites(void)
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo = (mobj_t *)th;
+5 -1
View File
@@ -220,7 +220,11 @@ HMS_connect (const char *format, ...)
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, (long)CURL_IPRESOLVE_V4);
#ifdef HAVE_IPV6
if (!M_CheckParm("-ipv6"))
#endif
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, (long)CURL_IPRESOLVE_V4);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)cv_masterserver_timeout.value);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HMS_on_read);
+4 -4
View File
@@ -82,6 +82,8 @@ typedef struct
char data[MAXPACKETLENGTH];
} ATTRPACK doomcom_t;
#define DOOMCOM_DATA(d) (doomdata_t *)&(d)->data
#ifdef HOLEPUNCH
typedef struct
{
@@ -89,6 +91,8 @@ typedef struct
INT32 addr;
INT16 port;
} ATTRPACK holepunch_t;
#define HOLEPUNCH_DATA(d) (holepunch_t *)&(d)->data
#endif
#if defined(_MSC_VER)
@@ -97,10 +101,6 @@ typedef struct
extern doomcom_t *doomcom;
#ifdef HOLEPUNCH
extern holepunch_t *holepunchpacket;
#endif
/** \brief return packet in doomcom struct
*/
extern boolean (*I_NetGet)(void);
+77 -21
View File
@@ -371,8 +371,16 @@ static inline void I_UPnP_rem(const char *port, const char * servicetype)
static const char *SOCK_AddrToStr(mysockaddr_t *sk)
{
static char s[64]; // 255.255.255.255:65535 or IPv6:65535
static char s[64]; // 255.255.255.255:65535 or
// [ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]:65535
#ifdef HAVE_NTOP
#ifdef HAVE_IPV6
int v6 = (sk->any.sa_family == AF_INET6);
#else
int v6 = 0;
#endif
void *addr;
int e = 0; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once
@@ -387,14 +395,20 @@ static const char *SOCK_AddrToStr(mysockaddr_t *sk)
if(addr == NULL)
sprintf(s, "No address");
else if(inet_ntop(sk->any.sa_family, addr, s, sizeof (s)) == NULL)
else if(inet_ntop(sk->any.sa_family, addr, &s[v6], sizeof (s) - v6) == NULL)
{
e = errno;
sprintf(s, "Unknown family type, error #%u: %s", e, strerror(e));
}
#ifdef HAVE_IPV6
else if(sk->any.sa_family == AF_INET6 && sk->ip6.sin6_port != 0)
strcat(s, va(":%d", ntohs(sk->ip6.sin6_port)));
else if(sk->any.sa_family == AF_INET6)
{
s[0] = '[';
strcat(s, "]");
if (sk->ip6.sin6_port != 0)
strcat(s, va(":%d", ntohs(sk->ip6.sin6_port)));
}
#endif
else if(sk->any.sa_family == AF_INET && sk->ip4.sin_port != 0)
strcat(s, va(":%d", ntohs(sk->ip4.sin_port)));
@@ -486,10 +500,30 @@ static time_t SOCK_GetUnbanTime(size_t ban)
}
#ifndef NONET
#ifdef HAVE_IPV6
static boolean SOCK_cmpipv6(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask)
{
UINT8 bitmask;
I_Assert(mask <= 128);
if (mask == 0)
mask = 128;
if (memcmp(&a->ip6.sin6_addr.s6_addr, &b->ip6.sin6_addr.s6_addr, mask / 8) != 0)
return false;
if (mask % 8 == 0)
return true;
bitmask = 255 << (mask % 8);
return (a->ip6.sin6_addr.s6_addr[mask / 8] & bitmask) == (b->ip6.sin6_addr.s6_addr[mask / 8] & bitmask);
}
#endif
static boolean SOCK_cmpaddr(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask)
{
UINT32 bitmask = INADDR_NONE;
if (a->any.sa_family != b->any.sa_family)
return false;
if (mask && mask < 32)
bitmask = htonl((UINT32)(-1) << (32 - mask));
@@ -498,13 +532,14 @@ static boolean SOCK_cmpaddr(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask)
&& (b->ip4.sin_port == 0 || (a->ip4.sin_port == b->ip4.sin_port));
#ifdef HAVE_IPV6
else if (b->any.sa_family == AF_INET6)
return memcmp(&a->ip6.sin6_addr, &b->ip6.sin6_addr, sizeof(b->ip6.sin6_addr))
return SOCK_cmpipv6(a, b, mask)
&& (b->ip6.sin6_port == 0 || (a->ip6.sin6_port == b->ip6.sin6_port));
#endif
else
return false;
}
// This is a hack. For some reason, nodes aren't being freed properly.
// This goes through and cleans up what nodes were supposed to be freed.
/** \warning This function causes the file downloading to stop if someone joins.
@@ -620,6 +655,7 @@ is_external_address (UINT32 p)
static boolean hole_punch(ssize_t c)
{
holepunch_t *holepunchpacket = HOLEPUNCH_DATA(doomcom);
/* See ../doc/Holepunch-Protocol.txt */
if (cv_rendezvousserver.string[0] &&
@@ -659,6 +695,7 @@ static boolean SOCK_Get(void)
fromlen = (socklen_t)sizeof(fromaddress);
c = recvfrom(mysockets[n], (char *)&doomcom->data, MAXPACKETLENGTH, 0,
(void *)&fromaddress, &fromlen);
if (c > 0)
{
#ifdef USE_STUN
@@ -868,11 +905,11 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
unsigned long trueval = true;
#endif
mysockaddr_t straddr;
struct sockaddr_in sin;
socklen_t len = sizeof(sin);
socklen_t len = sizeof(straddr);
if (s == (SOCKET_TYPE)ERRSOCKET)
return (SOCKET_TYPE)ERRSOCKET;
#ifdef USE_WINSOCK
{ // Alam_GBC: disable the new UDP connection reset behavior for Win2k and up
#ifdef USE_WINSOCK2
@@ -892,14 +929,12 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
}
#endif
straddr.any = *addr;
memcpy(&straddr, addr, addrlen);
I_OutputMsg("Binding to %s\n", SOCK_AddrToStr(&straddr));
if (family == AF_INET)
{
mysockaddr_t tmpaddr;
tmpaddr.any = *addr ;
if (tmpaddr.ip4.sin_addr.s_addr == htonl(INADDR_ANY))
if (straddr.ip4.sin_addr.s_addr == htonl(INADDR_ANY))
{
opt = true;
opts = (socklen_t)sizeof(opt);
@@ -924,7 +959,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
#ifdef HAVE_IPV6
else if (family == AF_INET6)
{
if (memcmp(addr, &in6addr_any, sizeof(in6addr_any)) == 0) //IN6_ARE_ADDR_EQUAL
if (memcmp(&straddr.ip6.sin6_addr, &in6addr_any, sizeof(in6addr_any)) == 0) //IN6_ARE_ADDR_EQUAL
{
opt = true;
opts = (socklen_t)sizeof(opt);
@@ -939,7 +974,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
// make it IPv6 ony
opt = true;
opts = (socklen_t)sizeof(opt);
rc = setsockopt(s, SOL_SOCKET, IPV6_V6ONLY, (char *)&opt, opts);
rc = setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&opt, opts);
if (rc <= -1)
{
e = errno;
@@ -969,7 +1004,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
inet_pton(AF_INET6, IPV6_MULTICAST_ADDRESS, &maddr.ipv6mr_multiaddr);
maddr.ipv6mr_interface = 0;
rc = setsockopt(s, SOL_SOCKET, IPV6_JOIN_GROUP, (const char *)&maddr, sizeof(maddr));
rc = setsockopt(s, IPPROTO_IPV6, IPV6_JOIN_GROUP, (const char *)&maddr, sizeof(maddr));
if (rc <= -1)
{
e = errno;
@@ -1032,7 +1067,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
CONS_Printf(M_GetText("Network system buffer set to: %dKb\n"), opt>>10);
}
rc = getsockname(s, (struct sockaddr *)&sin, &len);
rc = getsockname(s, &straddr.any, &len);
if (rc != 0)
{
e = errno;
@@ -1040,7 +1075,14 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
I_OutputMsg("getsockname failed: #%u, %s\n", e, strerror(e));
}
else
current_port = (UINT16)ntohs(sin.sin_port);
{
if (family == AF_INET)
current_port = (UINT16)ntohs(straddr.ip4.sin_port);
#ifdef HAVE_IPV6
else if (family == AF_INET6)
current_port = (UINT16)ntohs(straddr.ip6.sin6_port);
#endif
}
return s;
}
@@ -1121,6 +1163,7 @@ static boolean UDP_Socket(void)
I_freeaddrinfo(ai);
}
}
#ifdef HAVE_IPV6
if (b_ipv6)
{
@@ -1319,12 +1362,13 @@ static boolean SOCK_GetAddr(struct sockaddr_in *sin, const char *address, const
{
struct my_addrinfo *ai = NULL, *runp, hints;
int gaie;
size_t i;
if (!port || !port[0])
port = DEFAULTPORT;
memset (&hints, 0x00, sizeof (hints));
hints.ai_flags = 0;
hints.ai_flags = AI_ADDRCONFIG;
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP;
@@ -1343,10 +1387,19 @@ static boolean SOCK_GetAddr(struct sockaddr_in *sin, const char *address, const
{
while (runp != NULL)
{
if (sendto(mysockets[0], NULL, 0, 0, runp->ai_addr, runp->ai_addrlen) == 0)
break;
// test ip address of server
for (i = 0; i < mysocketses; ++i)
{
if (runp->ai_addr->sa_family == myfamily[i])
{
break;
}
}
runp = runp->ai_next;
if (i >= mysocketses)
runp = runp->ai_next;
else
break;
}
}
@@ -1390,6 +1443,8 @@ static void rendezvous(int size)
tic_t tic = I_GetTime();
holepunch_t *holepunchpacket = HOLEPUNCH_DATA(doomcom);
if (tic != refreshtic)
{
if (SOCK_GetAddr(&rzv.ip4, host, (port ? port : "7777"), false))
@@ -1415,6 +1470,7 @@ static void rendezvous(int size)
static void SOCK_RequestHolePunch(INT32 node)
{
mysockaddr_t * addr = &clientaddress[node];
holepunch_t *holepunchpacket = HOLEPUNCH_DATA(doomcom);
holepunchpacket->addr = addr->ip4.sin_addr.s_addr;
holepunchpacket->port = addr->ip4.sin_port;
@@ -1736,7 +1792,7 @@ boolean I_InitTcpNetwork(void)
// server address only in ip
if (serverhostname[0])
{
{
CONS_Printf("SERVERNAME: %s\n", serverhostname);
COM_BufAddText("connect \"");
COM_BufAddText(serverhostname);
-2
View File
@@ -145,8 +145,6 @@ boolean I_UseNativeKeyboard(void);
boolean I_CheckNativeRes(void);
void I_SetBorderlessWindow(void);
#ifdef USE_FBO_OGL
void RefreshOGLSDLSurface(void);
+2717 -2660
View File
File diff suppressed because it is too large. Load diff
+205 -202
View File
@@ -26,7 +26,7 @@
*/
typedef struct
{
actionf_p1 action; ///< Function pointer corresponding to the actual action.
actionf_t action; ///< Function pointer corresponding to the actual action.
const char *name; ///< Name of the action in ALL CAPS.
} actionpointer_t;
@@ -246,206 +246,209 @@ struct mobj_s;
// IMPORTANT NOTE: If you add/remove from this list of action
// functions, don't forget to update them in dehacked.c!
void A_Explode(void *actor);
void A_Pain(void *actor);
void A_Fall(void *actor);
void A_MonitorPop(void *actor);
void A_Look(void *actor);
void A_Chase(void *actor);
void A_FaceStabChase(void *actor);
void A_FaceTarget(void *actor);
void A_FaceTracer(void *actor);
void A_Scream(void *actor);
void A_BossDeath(void *actor);
void A_CustomPower(void *actor); // Use this for a custom power
void A_GiveWeapon(void *actor); // Gives the player weapon(s)
void A_JumpShield(void *actor); // Obtained Jump Shield
void A_RingShield(void *actor); // Obtained Ring Shield
void A_RingBox(void *actor); // Obtained Ring Box Tails
void A_Invincibility(void *actor); // Obtained Invincibility Box
void A_SuperSneakers(void *actor); // Obtained Super Sneakers Box
void A_BunnyHop(void *actor); // have bunny hop tails
void A_BubbleSpawn(void *actor); // Randomly spawn bubbles
void A_FanBubbleSpawn(void *actor);
void A_BubbleRise(void *actor); // Bubbles float to surface
void A_BubbleCheck(void *actor); // Don't draw if not underwater
void A_AwardScore(void *actor);
void A_ExtraLife(void *actor); // Extra Life
void A_BombShield(void *actor); // Obtained Bomb Shield
void A_WaterShield(void *actor); // Obtained Water Shield
void A_ForceShield(void *actor); // Obtained Force Shield
void A_PityShield(void *actor); // Obtained Pity Shield. We're... sorry.
void A_GravityBox(void *actor);
void A_ScoreRise(void *actor); // Rise the score logo
void A_ParticleSpawn(void *actor);
void A_AttractChase(void *actor); // Ring Chase
void A_DropMine(void *actor); // Drop Mine from Skim or Jetty-Syn Bomber
void A_FishJump(void *actor); // Fish Jump
void A_ThrownRing(void *actor); // Sparkle trail for red ring
void A_GrenadeRing(void *actor); // SRB2kart
void A_SetSolidSteam(void *actor);
void A_UnsetSolidSteam(void *actor);
void A_SignPlayer(void *actor);
void A_OverlayThink(void *actor);
void A_JetChase(void *actor);
void A_JetbThink(void *actor); // Jetty-Syn Bomber Thinker
void A_JetgThink(void *actor); // Jetty-Syn Gunner Thinker
void A_JetgShoot(void *actor); // Jetty-Syn Shoot Function
void A_ShootBullet(void *actor); // JetgShoot without reactiontime setting
void A_MinusDigging(void *actor);
void A_MinusPopup(void *actor);
void A_MinusCheck(void *actor);
void A_ChickenCheck(void *actor);
void A_MouseThink(void *actor); // Mouse Thinker
void A_DetonChase(void *actor); // Deton Chaser
void A_CapeChase(void *actor); // Fake little Super Sonic cape
void A_RotateSpikeBall(void *actor); // Spike ball rotation
void A_SlingAppear(void *actor);
void A_MaceRotate(void *actor);
void A_UnidusBall(void *actor);
void A_RockSpawn(void *actor);
void A_SetFuse(void *actor);
void A_CrawlaCommanderThink(void *actor); // Crawla Commander
void A_SmokeTrailer(void *actor);
void A_RingExplode(void *actor);
void A_OldRingExplode(void *actor);
void A_MixUp(void *actor);
void A_RecyclePowers(void *actor);
void A_BossScream(void *actor);
void A_Boss2TakeDamage(void *actor);
void A_GoopSplat(void *actor);
void A_Boss2PogoSFX(void *actor);
void A_Boss2PogoTarget(void *actor);
void A_EggmanBox(void *actor);
void A_TurretFire(void *actor);
void A_SuperTurretFire(void *actor);
void A_TurretStop(void *actor);
void A_JetJawRoam(void *actor);
void A_JetJawChomp(void *actor);
void A_PointyThink(void *actor);
void A_CheckBuddy(void *actor);
void A_HoodThink(void *actor);
void A_ArrowCheck(void *actor);
void A_SnailerThink(void *actor);
void A_SharpChase(void *actor);
void A_SharpSpin(void *actor);
void A_VultureVtol(void *actor);
void A_VultureCheck(void *actor);
void A_SkimChase(void *actor);
void A_SkullAttack(void *actor);
void A_LobShot(void *actor);
void A_FireShot(void *actor);
void A_SuperFireShot(void *actor);
void A_BossFireShot(void *actor);
void A_Boss7FireMissiles(void *actor);
void A_Boss1Laser(void *actor);
void A_FocusTarget(void *actor);
void A_Boss4Reverse(void *actor);
void A_Boss4SpeedUp(void *actor);
void A_Boss4Raise(void *actor);
void A_SparkFollow(void *actor);
void A_BuzzFly(void *actor);
void A_GuardChase(void *actor);
void A_EggShield(void *actor);
void A_SetReactionTime(void *actor);
void A_Boss1Spikeballs(void *actor);
void A_Boss3TakeDamage(void *actor);
void A_Boss3Path(void *actor);
void A_LinedefExecute(void *actor);
void A_PlaySeeSound(void *actor);
void A_PlayAttackSound(void *actor);
void A_PlayActiveSound(void *actor);
void A_1upThinker(void *actor);
void A_BossZoom(void *actor); //Unused
void A_Boss1Chase(void *actor);
void A_Boss2Chase(void *actor);
void A_Boss2Pogo(void *actor);
void A_Boss7Chase(void *actor);
void A_BossJetFume(void *actor);
void A_SpawnObjectAbsolute(void *actor);
void A_SpawnObjectRelative(void *actor);
void A_ChangeAngleRelative(void *actor);
void A_ChangeAngleAbsolute(void *actor);
void A_PlaySound(void *actor);
void A_FindTarget(void *actor);
void A_FindTracer(void *actor);
void A_SetTics(void *actor);
void A_SetRandomTics(void *actor);
void A_ChangeColorRelative(void *actor);
void A_ChangeColorAbsolute(void *actor);
void A_MoveRelative(void *actor);
void A_MoveAbsolute(void *actor);
void A_Thrust(void *actor);
void A_ZThrust(void *actor);
void A_SetTargetsTarget(void *actor);
void A_SetObjectFlags(void *actor);
void A_SetObjectFlags2(void *actor);
void A_RandomState(void *actor);
void A_RandomStateRange(void *actor);
void A_DualAction(void *actor);
void A_RemoteAction(void *actor);
void A_ToggleFlameJet(void *actor);
void A_ItemPop(void *actor); // SRB2kart
void A_JawzChase(void *actor); // SRB2kart
void A_JawzExplode(void *actor); // SRB2kart
void A_SPBChase(void *actor); // SRB2kart
void A_MineExplode(void *actor); // SRB2kart
void A_BallhogExplode(void *actor); // SRB2kart
void A_LightningFollowPlayer(void *actor); // SRB2kart: Lightning shield effect player chasing
void A_FZBoomFlash(void *actor); // SRB2kart
void A_FZBoomSmoke(void *actor); // SRB2kart
void A_RandomShadowFrame(void *actor); //SRB2kart: Shadow spawner frame randomizer
void A_RoamingShadowThinker(void *actor); // SRB2kart: Roaming Shadow moving + attacking players.
void A_MayonakaArrow(void *actor); //SRB2kart: midnight channel arrow sign
void A_ReaperThinker(void *actor); //SRB2kart: mementos reaper
void A_MementosTPParticles(void *actor); //SRB2kart: mementos teleporter particles. Man that's a lot of actions for my shite.
void A_FlameParticle(void *actor); // SRB2kart
void A_OrbitNights(void *actor);
void A_GhostMe(void *actor);
void A_SetObjectState(void *actor);
void A_SetObjectTypeState(void *actor);
void A_KnockBack(void *actor);
void A_PushAway(void *actor);
void A_RingDrain(void *actor);
void A_SplitShot(void *actor);
void A_MissileSplit(void *actor);
void A_MultiShot(void *actor);
void A_InstaLoop(void *actor);
void A_Custom3DRotate(void *actor);
void A_SearchForPlayers(void *actor);
void A_CheckRandom(void *actor);
void A_CheckTargetRings(void *actor);
void A_CheckRings(void *actor);
void A_CheckTotalRings(void *actor);
void A_CheckHealth(void *actor);
void A_CheckRange(void *actor);
void A_CheckHeight(void *actor);
void A_CheckTrueRange(void *actor);
void A_CheckThingCount(void *actor);
void A_CheckAmbush(void *actor);
void A_CheckCustomValue(void *actor);
void A_CheckCusValMemo(void *actor);
void A_SetCustomValue(void *actor);
void A_UseCusValMemo(void *actor);
void A_RelayCustomValue(void *actor);
void A_CusValAction(void *actor);
void A_ForceStop(void *actor);
void A_ForceWin(void *actor);
void A_SpikeRetract(void *actor);
void A_InfoState(void *actor);
void A_Repeat(void *actor);
void A_SetScale(void *actor);
void A_RemoteDamage(void *actor);
void A_HomingChase(void *actor);
void A_TrapShot(void *actor);
void A_VileTarget(void *actor);
void A_VileAttack(void *actor);
void A_VileFire(void *actor);
void A_BrakChase(void *actor);
void A_BrakFireShot(void *actor);
void A_BrakLobShot(void *actor);
void A_NapalmScatter(void *actor);
void A_SpawnFreshCopy(void *actor);
void A_Explode(struct mobj_s *actor);
void A_Pain(struct mobj_s *actor);
void A_Fall(struct mobj_s *actor);
void A_MonitorPop(struct mobj_s *actor);
void A_Look(struct mobj_s *actor);
void A_Chase(struct mobj_s *actor);
void A_FaceStabChase(struct mobj_s *actor);
void A_FaceTarget(struct mobj_s *actor);
void A_FaceTracer(struct mobj_s *actor);
void A_Scream(struct mobj_s *actor);
void A_BossDeath(struct mobj_s *actor);
void A_CustomPower(struct mobj_s *actor); // Use this for a custom power
void A_GiveWeapon(struct mobj_s *actor); // Gives the player weapon(s)
void A_JumpShield(struct mobj_s *actor); // Obtained Jump Shield
void A_RingShield(struct mobj_s *actor); // Obtained Ring Shield
void A_RingBox(struct mobj_s *actor); // Obtained Ring Box Tails
void A_Invincibility(struct mobj_s *actor); // Obtained Invincibility Box
void A_SuperSneakers(struct mobj_s *actor); // Obtained Super Sneakers Box
void A_BunnyHop(struct mobj_s *actor); // have bunny hop tails
void A_BubbleSpawn(struct mobj_s *actor); // Randomly spawn bubbles
void A_FanBubbleSpawn(struct mobj_s *actor);
void A_BubbleRise(struct mobj_s *actor); // Bubbles float to surface
void A_BubbleCheck(struct mobj_s *actor); // Don't draw if not underwater
void A_AwardScore(struct mobj_s *actor);
void A_ExtraLife(struct mobj_s *actor); // Extra Life
void A_BombShield(struct mobj_s *actor); // Obtained Bomb Shield
void A_WaterShield(struct mobj_s *actor); // Obtained Water Shield
void A_ForceShield(struct mobj_s *actor); // Obtained Force Shield
void A_PityShield(struct mobj_s *actor); // Obtained Pity Shield. We're... sorry.
void A_GravityBox(struct mobj_s *actor);
void A_ScoreRise(struct mobj_s *actor); // Rise the score logo
void A_ParticleSpawn(struct mobj_s *actor);
void A_AttractChase(struct mobj_s *actor); // Ring Chase
void A_DropMine(struct mobj_s *actor); // Drop Mine from Skim or Jetty-Syn Bomber
void A_FishJump(struct mobj_s *actor); // Fish Jump
void A_ThrownRing(struct mobj_s *actor); // Sparkle trail for red ring
void A_GrenadeRing(struct mobj_s *actor); // SRB2kart
void A_SetSolidSteam(struct mobj_s *actor);
void A_UnsetSolidSteam(struct mobj_s *actor);
void A_SignPlayer(struct mobj_s *actor);
void A_OverlayThink(struct mobj_s *actor);
void A_JetChase(struct mobj_s *actor);
void A_JetbThink(struct mobj_s *actor); // Jetty-Syn Bomber Thinker
void A_JetgThink(struct mobj_s *actor); // Jetty-Syn Gunner Thinker
void A_JetgShoot(struct mobj_s *actor); // Jetty-Syn Shoot Function
void A_ShootBullet(struct mobj_s *actor); // JetgShoot without reactiontime setting
void A_MinusDigging(struct mobj_s *actor);
void A_MinusPopup(struct mobj_s *actor);
void A_MinusCheck(struct mobj_s *actor);
void A_ChickenCheck(struct mobj_s *actor);
void A_MouseThink(struct mobj_s *actor); // Mouse Thinker
void A_DetonChase(struct mobj_s *actor); // Deton Chaser
void A_CapeChase(struct mobj_s *actor); // Fake little Super Sonic cape
void A_RotateSpikeBall(struct mobj_s *actor); // Spike ball rotation
void A_SlingAppear(struct mobj_s *actor);
void A_MaceRotate(struct mobj_s *actor);
void A_UnidusBall(struct mobj_s *actor);
void A_RockSpawn(struct mobj_s *actor);
void A_SetFuse(struct mobj_s *actor);
void A_CrawlaCommanderThink(struct mobj_s *actor); // Crawla Commander
void A_SmokeTrailer(struct mobj_s *actor);
void A_RingExplode(struct mobj_s *actor);
void A_OldRingExplode(struct mobj_s *actor);
void A_MixUp(struct mobj_s *actor);
void A_RecyclePowers(struct mobj_s *actor);
void A_BossScream(struct mobj_s *actor);
void A_Boss2TakeDamage(struct mobj_s *actor);
void A_GoopSplat(struct mobj_s *actor);
void A_Boss2PogoSFX(struct mobj_s *actor);
void A_Boss2PogoTarget(struct mobj_s *actor);
void A_EggmanBox(struct mobj_s *actor);
void A_TurretFire(struct mobj_s *actor);
void A_SuperTurretFire(struct mobj_s *actor);
void A_TurretStop(struct mobj_s *actor);
void A_JetJawRoam(struct mobj_s *actor);
void A_JetJawChomp(struct mobj_s *actor);
void A_PointyThink(struct mobj_s *actor);
void A_CheckBuddy(struct mobj_s *actor);
void A_HoodThink(struct mobj_s *actor);
void A_ArrowCheck(struct mobj_s *actor);
void A_SnailerThink(struct mobj_s *actor);
void A_SharpChase(struct mobj_s *actor);
void A_SharpSpin(struct mobj_s *actor);
void A_VultureVtol(struct mobj_s *actor);
void A_VultureCheck(struct mobj_s *actor);
void A_SkimChase(struct mobj_s *actor);
void A_SkullAttack(struct mobj_s *actor);
void A_LobShot(struct mobj_s *actor);
void A_FireShot(struct mobj_s *actor);
void A_SuperFireShot(struct mobj_s *actor);
void A_BossFireShot(struct mobj_s *actor);
void A_Boss7FireMissiles(struct mobj_s *actor);
void A_Boss1Laser(struct mobj_s *actor);
void A_FocusTarget(struct mobj_s *actor);
void A_Boss4Reverse(struct mobj_s *actor);
void A_Boss4SpeedUp(struct mobj_s *actor);
void A_Boss4Raise(struct mobj_s *actor);
void A_SparkFollow(struct mobj_s *actor);
void A_BuzzFly(struct mobj_s *actor);
void A_GuardChase(struct mobj_s *actor);
void A_EggShield(struct mobj_s *actor);
void A_SetReactionTime(struct mobj_s *actor);
void A_Boss1Spikeballs(struct mobj_s *actor);
void A_Boss3TakeDamage(struct mobj_s *actor);
void A_Boss3Path(struct mobj_s *actor);
void A_LinedefExecute(struct mobj_s *actor);
void A_PlaySeeSound(struct mobj_s *actor);
void A_PlayAttackSound(struct mobj_s *actor);
void A_PlayActiveSound(struct mobj_s *actor);
void A_1upThinker(struct mobj_s *actor);
void A_BossZoom(struct mobj_s *actor); //Unused
void A_Boss1Chase(struct mobj_s *actor);
void A_Boss2Chase(struct mobj_s *actor);
void A_Boss2Pogo(struct mobj_s *actor);
void A_Boss7Chase(struct mobj_s *actor);
void A_BossJetFume(struct mobj_s *actor);
void A_SpawnObjectAbsolute(struct mobj_s *actor);
void A_SpawnObjectRelative(struct mobj_s *actor);
void A_ChangeAngleRelative(struct mobj_s *actor);
void A_ChangeAngleAbsolute(struct mobj_s *actor);
void A_RollAngle(struct mobj_s *actor);
void A_ChangeRollAngleRelative(struct mobj_s *actor);
void A_ChangeRollAngleAbsolute(struct mobj_s *actor);
void A_PlaySound(struct mobj_s *actor);
void A_FindTarget(struct mobj_s *actor);
void A_FindTracer(struct mobj_s *actor);
void A_SetTics(struct mobj_s *actor);
void A_SetRandomTics(struct mobj_s *actor);
void A_ChangeColorRelative(struct mobj_s *actor);
void A_ChangeColorAbsolute(struct mobj_s *actor);
void A_MoveRelative(struct mobj_s *actor);
void A_MoveAbsolute(struct mobj_s *actor);
void A_Thrust(struct mobj_s *actor);
void A_ZThrust(struct mobj_s *actor);
void A_SetTargetsTarget(struct mobj_s *actor);
void A_SetObjectFlags(struct mobj_s *actor);
void A_SetObjectFlags2(struct mobj_s *actor);
void A_RandomState(struct mobj_s *actor);
void A_RandomStateRange(struct mobj_s *actor);
void A_DualAction(struct mobj_s *actor);
void A_RemoteAction(struct mobj_s *actor);
void A_ToggleFlameJet(struct mobj_s *actor);
void A_ItemPop(struct mobj_s *actor); // SRB2kart
void A_JawzChase(struct mobj_s *actor); // SRB2kart
void A_JawzExplode(struct mobj_s *actor); // SRB2kart
void A_SPBChase(struct mobj_s *actor); // SRB2kart
void A_MineExplode(struct mobj_s *actor); // SRB2kart
void A_BallhogExplode(struct mobj_s *actor); // SRB2kart
void A_LightningFollowPlayer(struct mobj_s *actor); // SRB2kart: Lightning shield effect player chasing
void A_FZBoomFlash(struct mobj_s *actor); // SRB2kart
void A_FZBoomSmoke(struct mobj_s *actor); // SRB2kart
void A_RandomShadowFrame(struct mobj_s *actor); //SRB2kart: Shadow spawner frame randomizer
void A_RoamingShadowThinker(struct mobj_s *actor); // SRB2kart: Roaming Shadow moving + attacking players.
void A_MayonakaArrow(struct mobj_s *actor); //SRB2kart: midnight channel arrow sign
void A_ReaperThinker(struct mobj_s *actor); //SRB2kart: mementos reaper
void A_MementosTPParticles(struct mobj_s *actor); //SRB2kart: mementos teleporter particles. Man that's a lot of actions for my shite.
void A_FlameParticle(struct mobj_s *actor); // SRB2kart
void A_OrbitNights(struct mobj_s *actor);
void A_GhostMe(struct mobj_s *actor);
void A_SetObjectState(struct mobj_s *actor);
void A_SetObjectTypeState(struct mobj_s *actor);
void A_KnockBack(struct mobj_s *actor);
void A_PushAway(struct mobj_s *actor);
void A_RingDrain(struct mobj_s *actor);
void A_SplitShot(struct mobj_s *actor);
void A_MissileSplit(struct mobj_s *actor);
void A_MultiShot(struct mobj_s *actor);
void A_InstaLoop(struct mobj_s *actor);
void A_Custom3DRotate(struct mobj_s *actor);
void A_SearchForPlayers(struct mobj_s *actor);
void A_CheckRandom(struct mobj_s *actor);
void A_CheckTargetRings(struct mobj_s *actor);
void A_CheckRings(struct mobj_s *actor);
void A_CheckTotalRings(struct mobj_s *actor);
void A_CheckHealth(struct mobj_s *actor);
void A_CheckRange(struct mobj_s *actor);
void A_CheckHeight(struct mobj_s *actor);
void A_CheckTrueRange(struct mobj_s *actor);
void A_CheckThingCount(struct mobj_s *actor);
void A_CheckAmbush(struct mobj_s *actor);
void A_CheckCustomValue(struct mobj_s *actor);
void A_CheckCusValMemo(struct mobj_s *actor);
void A_SetCustomValue(struct mobj_s *actor);
void A_UseCusValMemo(struct mobj_s *actor);
void A_RelayCustomValue(struct mobj_s *actor);
void A_CusValAction(struct mobj_s *actor);
void A_ForceStop(struct mobj_s *actor);
void A_ForceWin(struct mobj_s *actor);
void A_SpikeRetract(struct mobj_s *actor);
void A_InfoState(struct mobj_s *actor);
void A_Repeat(struct mobj_s *actor);
void A_SetScale(struct mobj_s *actor);
void A_RemoteDamage(struct mobj_s *actor);
void A_HomingChase(struct mobj_s *actor);
void A_TrapShot(struct mobj_s *actor);
void A_VileTarget(struct mobj_s *actor);
void A_VileAttack(struct mobj_s *actor);
void A_VileFire(struct mobj_s *actor);
void A_BrakChase(struct mobj_s *actor);
void A_BrakFireShot(struct mobj_s *actor);
void A_BrakLobShot(struct mobj_s *actor);
void A_NapalmScatter(struct mobj_s *actor);
void A_SpawnFreshCopy(struct mobj_s *actor);
extern boolean actionsoverridden[NUMACTIONS];
@@ -4309,7 +4312,7 @@ typedef struct
spritenum_t sprite;
UINT32 frame; // we use the upper 16 bits for translucency and other shade effects
INT32 tics;
actionf_p1 action;
actionf_t action;
INT32 var1;
INT32 var2;
statenum_t nextstate;
+21 -23
View File
@@ -522,7 +522,6 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
dest_colormap[i] = (UINT8)i;
continue;
}
color = V_GetColor(i);
SETBRIGHTNESS(brightness, color.s.red, color.s.green, color.s.blue);
brightdif = 256;
@@ -2441,7 +2440,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto
static void K_RemoveGrowShrink(player_t *player)
{
if (!P_MobjWasRemoved(player->mo))
if (player->mo && !P_MobjWasRemoved(player->mo))
{
if (player->kartstuff[k_growshrinktimer] > 0) // Play Shrink noise
S_StartSound(player->mo, sfx_kc59);
@@ -2854,7 +2853,7 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
mobj->momy = FixedMul(FixedDiv(mobjy - y, dist), FixedDiv(dist, 6*FRACUNIT));
mobj->momz = FixedMul(FixedDiv(mobjz - z, dist), FixedDiv(dist, 6*FRACUNIT));
if (!P_MobjWasRemoved(source))
if (source && !P_MobjWasRemoved(source))
P_SetTarget(&mobj->target, source);
}
}
@@ -3085,7 +3084,7 @@ static void K_SpawnDriftSparks(player_t *player)
const boolean onground = P_IsObjectOnGround(player->mo);
// kinda sketchy
if (!cv_airsparks.value && !onground)
if (!cv_airsparks.value && onground)
return;
if (!player->kartstuff[k_drift] || player->kartstuff[k_driftcharge] < K_GetKartDriftSparkValue(player))
@@ -3667,7 +3666,7 @@ static mobj_t *K_FindLastTrailMobj(player_t *player)
if (!player || !(trail = player->mo) || !player->mo->hnext || !player->mo->hnext->health)
return NULL;
while (!P_MobjWasRemoved(trail->hnext) && trail->hnext->health)
while (trail->hnext && !P_MobjWasRemoved(trail->hnext) && trail->hnext->health)
{
trail = trail->hnext;
}
@@ -3904,7 +3903,7 @@ void K_PuntMine(mobj_t *thismine, mobj_t *punter)
fixed_t spd;
mobj_t *mine;
if (P_MobjWasRemoved(thismine))
if (!thismine || P_MobjWasRemoved(thismine))
return;
//This guarantees you hit a mine being dragged
@@ -3933,7 +3932,7 @@ void K_PuntMine(mobj_t *thismine, mobj_t *punter)
else
mine = thismine;
if (P_MobjWasRemoved(mine))
if (!mine || P_MobjWasRemoved(mine))
return;
spd = K_GetProjectileSpeed();
@@ -4100,8 +4099,7 @@ void K_DoSneaker(player_t *player, INT32 type)
if (player->mo->hnext)
{
mobj_t *cur = player->mo->hnext;
while (!P_MobjWasRemoved(cur))
while (cur && !P_MobjWasRemoved(cur))
{
if (!cur->tracer)
{
@@ -4165,7 +4163,7 @@ static void K_DoShrink(player_t *user)
K_DropItems(&players[i]);
players[i].kartstuff[k_growshrinktimer] = -(20*TICRATE);
if (!P_MobjWasRemoved(players[i].mo))
if (players[i].mo && !P_MobjWasRemoved(players[i].mo))
{
players[i].mo->scalespeed = mapobjectscale/TICRATE;
players[i].mo->destscale = (6*mapobjectscale)/8;
@@ -4295,7 +4293,7 @@ void K_DropHnextList(player_t *player)
mobjtype_t type;
boolean orbit, ponground, dropall = true;
if (P_MobjWasRemoved(work))
if (!work || P_MobjWasRemoved(work))
return;
flip = P_MobjFlip(player->mo);
@@ -4434,7 +4432,7 @@ void K_DropItems(player_t *player)
K_DropHnextList(player);
if (!P_MobjWasRemoved(player->mo) && player->kartstuff[k_itemamount])
if (player->mo && !P_MobjWasRemoved(player->mo) && player->kartstuff[k_itemamount])
{
mobj_t *drop = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height/2, MT_FLOATINGITEM);
P_SetScale(drop, drop->scale>>4);
@@ -4463,7 +4461,7 @@ void K_DropRocketSneaker(player_t *player)
fixed_t flingangle;
boolean leftshoe = true; //left shoe is first
if (!(!P_MobjWasRemoved(player->mo) && player->mo->hnext && !P_MobjWasRemoved(player->mo->hnext)))
if (!(player->mo && !P_MobjWasRemoved(player->mo) && player->mo->hnext && !P_MobjWasRemoved(player->mo->hnext)))
return;
while ((shoe = shoe->hnext) && !P_MobjWasRemoved(shoe))
@@ -4502,7 +4500,7 @@ void K_DropRocketSneaker(player_t *player)
void K_DropKitchenSink(player_t *player)
{
if (!(!P_MobjWasRemoved(player->mo) && player->mo->hnext && !P_MobjWasRemoved(player->mo->hnext)))
if (!(player->mo && !P_MobjWasRemoved(player->mo) && player->mo->hnext && !P_MobjWasRemoved(player->mo->hnext)))
return;
if (player->mo->hnext->type != MT_SINK_SHIELD)
@@ -4519,13 +4517,13 @@ void K_RepairOrbitChain(mobj_t *orbit)
mobj_t *cachenext = orbit->hnext;
// First, repair the chain
if (!P_MobjWasRemoved(orbit->hnext) && orbit->hnext->health)
if (orbit->hnext && orbit->hnext->health && !P_MobjWasRemoved(orbit->hnext))
{
P_SetTarget(&orbit->hnext->hprev, orbit->hprev);
P_SetTarget(&orbit->hnext, NULL);
}
if (!P_MobjWasRemoved(orbit->hprev) && orbit->hprev->health)
if (orbit->hprev && orbit->hprev->health && !P_MobjWasRemoved(orbit->hprev))
{
P_SetTarget(&orbit->hprev->hnext, cachenext);
P_SetTarget(&orbit->hprev, NULL);
@@ -4540,7 +4538,7 @@ void K_RepairOrbitChain(mobj_t *orbit)
mobj_t *cur = orbit->target->hnext;
mobj_t *prev = NULL;
while (!P_MobjWasRemoved(cur))
while (cur && !P_MobjWasRemoved(cur))
{
prev = cur;
cur = cur->hnext;
@@ -4740,7 +4738,7 @@ static void K_MoveHeldObjects(player_t *player)
player->kartstuff[k_bananadrag] = 0; // Just to make sure
while (!P_MobjWasRemoved(cur))
while (cur && !P_MobjWasRemoved(cur))
{
const fixed_t radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(cur->radius, cur->radius); // mobj's distance from its Target, or Radius.
fixed_t z;
@@ -4818,7 +4816,7 @@ static void K_MoveHeldObjects(player_t *player)
if (P_IsObjectOnGround(player->mo) && player->speed > 0)
player->kartstuff[k_bananadrag]++;
while (!P_MobjWasRemoved(cur))
while (cur && !P_MobjWasRemoved(cur))
{
const fixed_t radius = FixedHypot(targ->radius, targ->radius) + FixedHypot(cur->radius, cur->radius);
angle_t ang;
@@ -4846,7 +4844,7 @@ static void K_MoveHeldObjects(player_t *player)
else
dist = cur->extravalue1/2;
if (P_MobjWasRemoved(targ))
if (!targ || P_MobjWasRemoved(targ))
continue;
// Shrink your items if the player shrunk too.
@@ -4904,7 +4902,7 @@ static void K_MoveHeldObjects(player_t *player)
mobj_t *cur = player->mo->hnext;
INT32 num = 0;
while (!P_MobjWasRemoved(cur))
while (cur && !P_MobjWasRemoved(cur))
{
const fixed_t radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(cur->radius, cur->radius);
boolean vibrate = ((leveltime & 1) && !cur->tracer);
@@ -4969,7 +4967,7 @@ static void K_MoveHeldObjects(player_t *player)
}
if (!P_MobjWasRemoved(cur->tracer))
if (cur->tracer && !P_MobjWasRemoved(cur->tracer))
{
fixed_t diffx, diffy, diffz;
@@ -5710,7 +5708,7 @@ void K_KartPlayerAfterThink(player_t *player)
else
targ = K_FindJawzTarget(player->mo, player);
if (!targ || P_MobjWasRemoved(targ->mo))
if (!targ || !targ->mo || P_MobjWasRemoved(targ->mo))
{
player->kartstuff[k_lastjawztarget] = -1;
player->kartstuff[k_jawztargetdelay] = 0;
+7 -7
View File
@@ -181,7 +181,7 @@ static int lib_setState(lua_State *L)
switch(lua_type(L, 3))
{
case LUA_TNIL: // Null? Set the action to nothing, then.
state->action = NULL;
state->action.acp1 = NULL;
break;
case LUA_TSTRING: // It's a string, expect the name of a built-in action
LUA_SetActionByName(state, lua_tostring(L, 3));
@@ -193,7 +193,7 @@ static int lib_setState(lua_State *L)
lua_pushvalue(L, 3); // Bring it to the top of the stack
lua_rawset(L, -3); // Set it in the registry
lua_pop(L, 1); // pop LREG_STATEACTION
state->action = (actionf_p1)A_Lua; // Set the action for the userdata.
state->action.acp1 = (actionf_p1)A_Lua; // Set the action for the userdata.
break;
default: // ?!
return luaL_typerror(L, 3, "function");
@@ -251,7 +251,7 @@ boolean LUA_SetLuaAction(void *stv, const char *action)
lua_pop(gL, 1); // pop LREG_STATEACTION
lua_pop(gL, 2); // pop the function and LREG_ACTIONS
st->action = (actionf_p1)A_Lua; // Set the action for the userdata.
st->action.acp1 = (actionf_p1)A_Lua; // Set the action for the userdata.
return true; // action successfully set.
}
@@ -350,9 +350,9 @@ static int state_get(lua_State *L)
case state_action:
{
const char *name;
if (!st->action) // Action is NULL.
if (!st->action.acp1) // Action is NULL.
return 0; // return nil.
if (st->action == (actionf_p1)A_Lua) { // This is a Lua function?
if (st->action.acp1 == (actionf_p1)A_Lua) { // This is a Lua function?
lua_getfield(L, LUA_REGISTRYINDEX, LREG_STATEACTION);
I_Assert(lua_istable(L, -1));
lua_pushlightuserdata(L, st); // Push the state pointer and
@@ -428,7 +428,7 @@ static int state_set(lua_State *L)
switch(lua_type(L, 3))
{
case LUA_TNIL: // Null? Set the action to nothing, then.
st->action = NULL;
st->action.acp1 = NULL;
break;
case LUA_TSTRING: // It's a string, expect the name of a built-in action
LUA_SetActionByName(st, lua_tostring(L, 3));
@@ -440,7 +440,7 @@ static int state_set(lua_State *L)
lua_pushvalue(L, 3); // Bring it to the top of the stack
lua_rawset(L, -3); // Set it in the registry
lua_pop(L, 1); // pop LREG_STATEACTION
st->action = (actionf_p1)A_Lua; // Set the action for the userdata.
st->action.acp1 = (actionf_p1)A_Lua; // Set the action for the userdata.
break;
default: // ?!
return luaL_typerror(L, 3, "function");
+1 -1
View File
@@ -227,4 +227,4 @@ int LUA_MathLib(lua_State *L)
lua_pushvalue(L, LUA_GLOBALSINDEX);
luaL_register(L, NULL, lib);
return 0;
}
}
+5 -8
View File
@@ -1224,7 +1224,7 @@ void LUA_Archive(savebuffer_t *save, boolean network)
{
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
// archive function will determine when to skip mobjs,
@@ -1264,18 +1264,15 @@ void LUA_UnArchive(savebuffer_t *save, boolean network)
{
do {
mobjnum = READUINT32(save->p); // read a mobjnum
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
if (((mobj_t *)th)->mobjnum != mobjnum) // find matching mobj
continue;
UnArchiveExtVars(&save->p, th, network); // apply variables
if (((mobj_t *)th)->mobjnum == mobjnum) // find matching mobj
UnArchiveExtVars(&save->p, th, network); // apply variables
}
} while (mobjnum != UINT32_MAX); // repeat until end of mobjs marker.
} while(mobjnum != UINT32_MAX); // repeat until end of mobjs marker.
LUA_HookNetArchive(NetUnArchive, save); // call the NetArchive hook in unarchive mode
}
+4 -4
View File
@@ -32,7 +32,7 @@ struct iterationState {
int next;
};
FUNCINLINE static ATTRINLINE int iterationState_gc(lua_State *L)
static int iterationState_gc(lua_State *L)
{
struct iterationState *it = luaL_checkudata(L, -1, META_ITERATIONSTATE);
if (it->next != LUA_REFNIL)
@@ -44,7 +44,7 @@ FUNCINLINE static ATTRINLINE int iterationState_gc(lua_State *L)
}
#define push_thinker(th) {\
if ((th)->function == (actionf_p1)P_MobjThinker) \
if ((th)->function.acp1 == (actionf_p1)P_MobjThinker) \
LUA_PushUserdata(L, (th), META_MOBJ); \
else \
lua_pushlightuserdata(L, (th)); \
@@ -88,7 +88,7 @@ static int lib_iterateThinkers(lua_State *L)
return luaL_error(L, "next thinker invalidated during iteration");
for (; next != &thinkercap; next = next->next)
if (!it->filter || next->function == it->filter)
if (!it->filter || next->function.acp1 == it->filter)
{
push_thinker(next);
if (next->next != &thinkercap)
@@ -130,4 +130,4 @@ int LUA_ThinkerLib(lua_State *L)
lua_setfield(L, -2, "iterate");
lua_setglobal(L, "thinkers");
return 0;
}
}
+1 -1
View File
@@ -732,7 +732,7 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo = (mobj_t *)th;
+1 -4
View File
@@ -7768,10 +7768,7 @@ static void M_PlaybackRewind(INT32 choice)
S_PauseAudio();
}
else
{
demo.rewinding = true;
paused = true;
}
demo.rewinding = paused = true;
}
else if (lastconfirmtime + TICRATE/2 < I_GetTime())
{
+8 -8
View File
@@ -590,9 +590,9 @@ static void PS_CountThinkers(void)
{
ps_thinkercount.value.i++;
if (thinker->function == (actionf_p1)P_RemoveThinkerDelayed)
if (thinker->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
ps_removecount.value.i++;
else if (thinker->function == (actionf_p1)P_MobjThinker)
else if (thinker->function.acp1 == (actionf_p1)P_MobjThinker)
{
mobj_t *mobj = (mobj_t*)thinker;
ps_mobjcount.value.i++;
@@ -609,7 +609,7 @@ static void PS_CountThinkers(void)
for (thinker = precipcap.next; thinker != &precipcap; thinker = thinker->next)
{
if (thinker->function != (actionf_p1)P_NullPrecipThinker)
if (thinker->function.acp1 != (actionf_p1)P_NullPrecipThinker)
continue; // not a precipmobj thinker
ps_precipcount.value.i++;
@@ -620,7 +620,7 @@ static void PS_CountThinkers(void)
for (thinker = thlist[i].next; thinker != &thlist[i]; thinker = thinker->next)
{
ps_thinkercount.value.i++;
if (thinker->function == (actionf_p1)P_RemoveThinkerDelayed)
if (thinker->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
ps_removecount.value.i++;
else if (i == THINK_POLYOBJ)
ps_polythcount.value.i++;
@@ -628,7 +628,7 @@ static void PS_CountThinkers(void)
ps_mainthcount.value.i++;
else if (i == THINK_MOBJ)
{
if (thinker->function == (actionf_p1)P_MobjThinker)
if (thinker->function.acp1 == (actionf_p1)P_MobjThinker)
{
mobj_t *mobj = (mobj_t*)thinker;
ps_mobjcount.value.i++;
@@ -739,7 +739,7 @@ static void PS_DrawDescriptorHeader(void)
int samples_left = max(ps_frame_samples_left, ps_tick_samples_left);
int x, y;
if (cv_perfstats.value >= 3)
if (cv_perfstats.value >= 3)
{
x = 2;
y = 0;
@@ -892,7 +892,7 @@ static void draw_think_frame_stats(int hook_length, ps_hookinfo_t *hook)
PS_DrawDescriptorHeader();
for (i = 0; i < hook_length; i++)
for (i = 0; i < hook_length; i++)
{
#define NEXT_ROW() y += HEIGHT;
@@ -1010,7 +1010,7 @@ void M_DrawPerfStats(void)
// tics when frame skips happen
PS_DrawGameLogicStats();
}
else if (cv_perfstats.value >= 3) // lua thinkframe
else if (cv_perfstats.value >= 3) // lua thinkframe
{
if (!PS_IsLevelActive())
return;
+4
View File
@@ -30,7 +30,11 @@ typedef union
typedef struct
{
msg_header_t header;
#ifndef HAVE_IPV6
char ip[16];
#else
char ip[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"];
#endif
char port[8];
char contact[32];
char version[8]; // format is: x.yy.z (like 1.30.2 or 1.31)
+2 -2
View File
@@ -412,7 +412,7 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
ceiling = Z_Calloc(sizeof (*ceiling), PU_LEVSPEC, NULL);
P_AddThinker(&ceiling->thinker);
sec->ceilingdata = ceiling;
ceiling->thinker.function = (actionf_p1)T_MoveCeiling;
ceiling->thinker.function.acp1 = (actionf_p1)T_MoveCeiling;
ceiling->sector = sec;
ceiling->crush = false;
ceiling->sourceline = (INT32)(line-lines);
@@ -635,7 +635,7 @@ INT32 EV_DoCrush(line_t *line, ceiling_e type)
ceiling = Z_Calloc(sizeof (*ceiling), PU_LEVSPEC, NULL);
P_AddThinker(&ceiling->thinker);
sec->ceilingdata = ceiling;
ceiling->thinker.function = (actionf_p1)T_CrushCeiling;
ceiling->thinker.function.acp1 = (actionf_p1)T_CrushCeiling;
ceiling->sector = sec;
ceiling->crush = true;
ceiling->sourceline = (INT32)(line-lines);
+885 -1008
View File
File diff suppressed because it is too large. Load diff
+7 -7
View File
@@ -2483,7 +2483,7 @@ void T_CameraScanner(elevator_t *elevator)
for (UINT8 i = 0; i <= splitscreen; i++)
{
if (P_MobjWasRemoved(players[displayplayers[i]].mo))
if (!players[displayplayers[i]].mo || P_MobjWasRemoved(players[displayplayers[i]].mo))
continue;
if (players[displayplayers[i]].mo->subsector->sector == elevator->actionsector)
@@ -2545,7 +2545,7 @@ INT32 EV_DoFloor(line_t *line, floor_e floortype)
sec->floordata = dofloor;
// set up some generic aspects of the floormove_t
dofloor->thinker.function = (actionf_p1)T_MoveFloor;
dofloor->thinker.function.acp1 = (actionf_p1)T_MoveFloor;
dofloor->type = floortype;
dofloor->crush = false; // default: types that crush will change this
dofloor->sector = sec;
@@ -2766,7 +2766,7 @@ INT32 EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed)
P_AddThinker(&elevator->thinker);
sec->floordata = elevator;
sec->ceilingdata = elevator;
elevator->thinker.function = (actionf_p1)T_MoveElevator;
elevator->thinker.function.acp1 = (actionf_p1)T_MoveElevator;
elevator->type = elevtype;
elevator->sourceline = line;
elevator->distance = 1; // Always crush unless otherwise
@@ -2954,7 +2954,7 @@ INT32 EV_BounceSector(sector_t *sec, fixed_t momz, line_t *sourceline)
bouncer = Z_Calloc(sizeof (*bouncer), PU_LEVSPEC, NULL);
P_AddThinker(&bouncer->thinker);
sec->ceilingdata = bouncer;
bouncer->thinker.function = (actionf_p1)T_BounceCheese;
bouncer->thinker.function.acp1 = (actionf_p1)T_BounceCheese;
// set up the fields according to the type of elevator action
bouncer->sector = sec;
@@ -2991,7 +2991,7 @@ INT32 EV_DoContinuousFall(sector_t *sec, sector_t *backsector, fixed_t spd, bool
// create and initialize new thinker
faller = Z_Calloc(sizeof (*faller), PU_LEVSPEC, NULL);
P_AddThinker(&faller->thinker);
faller->thinker.function = (actionf_p1)T_ContinuousFalling;
faller->thinker.function.acp1 = (actionf_p1)T_ContinuousFalling;
// set up the fields
faller->sector = sec;
@@ -3044,7 +3044,7 @@ INT32 EV_StartCrumble(sector_t *sec, ffloor_t *rover, boolean floating,
// create and initialize new elevator thinker
elevator = Z_Calloc(sizeof (*elevator), PU_LEVSPEC, NULL);
P_AddThinker(&elevator->thinker);
elevator->thinker.function = (actionf_p1)T_StartCrumble;
elevator->thinker.function.acp1 = (actionf_p1)T_StartCrumble;
// Does this crumbler return?
if (crumblereturn)
@@ -3123,7 +3123,7 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob
P_AddThinker(&block->thinker);
sec->floordata = block;
sec->ceilingdata = block;
block->thinker.function = (actionf_p1)T_MarioBlock;
block->thinker.function.acp1 = (actionf_p1)T_MarioBlock;
// Set up the fields
block->sector = sec;
+8 -8
View File
@@ -473,7 +473,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (player->spectator)
return;
if (!P_MobjWasRemoved(special->tracer) && toucher == special->tracer)
if (special->tracer && !P_MobjWasRemoved(special->tracer) && toucher == special->tracer)
{
mobj_t *spbexplode;
@@ -487,7 +487,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
spbexplode = P_SpawnMobj(toucher->x, toucher->y, toucher->z, MT_SPBEXPLOSION);
spbexplode->extravalue1 = 1; // Tell K_ExplodePlayer to use extra knockback
if (!P_MobjWasRemoved(special->target))
if (special->target && !P_MobjWasRemoved(special->target))
P_SetTarget(&spbexplode->target, special->target);
P_RemoveMobj(special);
@@ -496,7 +496,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
K_SpinPlayer(player, special->target, 0, special, false);
return;
case MT_SMK_MOLE:
if (!P_MobjWasRemoved(special->target))
if (special->target && !P_MobjWasRemoved(special->target))
return;
if (special->health <= 0 || toucher->health <= 0)
@@ -961,7 +961,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// scan the remaining thinkers to find koopa
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
@@ -1765,7 +1765,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
case MT_SMK_ICEBLOCK:
{
mobj_t *cur = target->hnext;
while (!P_MobjWasRemoved(cur))
while (cur && !P_MobjWasRemoved(cur))
{
P_SetMobjState(cur, S_SMK_ICEBLOCK2);
cur = cur->hnext;
@@ -1816,7 +1816,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
// this can happen if the boss was hurt earlier than expected
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo = (mobj_t *)th;
@@ -1838,14 +1838,14 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
// kill tracer
if (target->type == MT_FROGGER)
{
if (!P_MobjWasRemoved(target->tracer))
if (target->tracer && !P_MobjWasRemoved(target->tracer))
P_KillMobj(target->tracer, inflictor, source);
}
if (target->type == MT_FROGGER || target->type == MT_ROBRA_HEAD || target->type == MT_BLUEROBRA_HEAD) // clean hnext list
{
mobj_t *cur = target->hnext;
while (!P_MobjWasRemoved(cur))
while (cur && !P_MobjWasRemoved(cur))
{
P_KillMobj(cur, inflictor, source);
cur = cur->hnext;
+6 -6
View File
@@ -78,7 +78,7 @@ fireflicker_t *P_SpawnAdjustableFireFlicker(sector_t *minsector, sector_t *maxse
P_AddThinker(&flick->thinker);
flick->thinker.function = (actionf_p1)T_FireFlicker;
flick->thinker.function.acp1 = (actionf_p1)T_FireFlicker;
flick->sector = maxsector;
flick->maxlight = maxsector->lightlevel;
flick->minlight = minsector->lightlevel;
@@ -140,7 +140,7 @@ void P_SpawnLightningFlash(sector_t *sector)
if (sector->lightingdata)
{
if (((lightflash_t *)sector->lightingdata)->thinker.function
if (((lightflash_t *)sector->lightingdata)->thinker.function.acp1
== (actionf_p1)T_LightningFlash)
{
// lightning was already flashing in this sector
@@ -157,7 +157,7 @@ void P_SpawnLightningFlash(sector_t *sector)
P_AddThinker(&flash->thinker);
flash->thinker.function = (actionf_p1)T_LightningFlash;
flash->thinker.function.acp1 = (actionf_p1)T_LightningFlash;
flash->sector = sector;
flash->maxlight = 255;
flash->minlight = minlight;
@@ -219,7 +219,7 @@ strobe_t *P_SpawnAdjustableStrobeFlash(sector_t *minsector, sector_t *maxsector,
flash->sector = maxsector;
flash->darktime = darktime;
flash->brighttime = brighttime;
flash->thinker.function = (actionf_p1)T_StrobeFlash;
flash->thinker.function.acp1 = (actionf_p1)T_StrobeFlash;
flash->maxlight = maxsector->lightlevel;
flash->minlight = minsector->lightlevel;
@@ -301,7 +301,7 @@ glow_t *P_SpawnAdjustableGlowingLight(sector_t *minsector, sector_t *maxsector,
g->minlight = g->maxlight;
g->maxlight = oops;
}
g->thinker.function = (actionf_p1)T_Glow;
g->thinker.function.acp1 = (actionf_p1)T_Glow;
g->direction = 1;
g->speed = length/4;
if (g->speed > (g->maxlight - g->minlight)/2) // don't make it ridiculous speed
@@ -347,7 +347,7 @@ void P_FadeLight(INT16 tag, INT32 destvalue, INT32 speed)
P_RemoveLighting(sector); // remove the old lighting effect first
ll = Z_Calloc(sizeof (*ll), PU_LEVSPEC, NULL);
ll->thinker.function = (actionf_p1)T_LightFade;
ll->thinker.function.acp1 = (actionf_p1)T_LightFade;
sector->lightingdata = ll; // set it to the lightlevel_t
P_AddThinker(&ll->thinker); // add thinker
+1 -1
View File
@@ -279,7 +279,7 @@ void P_SceneryThinker(mobj_t *mobj);
// To test it in Lua, check mobj.valid
FUNCINLINE static ATTRINLINE boolean P_MobjWasRemoved(const mobj_t *mobj)
{
return (!mobj || mobj->thinker.function != (actionf_p1)P_MobjThinker);
return (!mobj || mobj->thinker.function.acp1 != (actionf_p1)P_MobjThinker);
}
fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect);
+2 -2
View File
@@ -321,7 +321,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
// Ignore... things.
if (!tmthing || P_MobjWasRemoved(thing))
if (!tmthing || !thing || P_MobjWasRemoved(thing))
return true;
I_Assert(!P_MobjWasRemoved(tmthing));
@@ -3626,7 +3626,7 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush)
for (think = thinkercap.next; think != &thinkercap; think = think->next)
{
if (think->function != (actionf_p1)T_StartCrumble)
if (think->function.acp1 != (actionf_p1)T_StartCrumble)
continue;
crumbler = (elevator_t *)think;
+1444 -1519
View File
File diff suppressed because it is too large. Load diff
+13 -13
View File
@@ -1557,7 +1557,7 @@ void Polyobj_InitLevel(void)
// the mobj_t pointers on a queue for use below.
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mobj_t *mo = (mobj_t *)th;
@@ -1832,7 +1832,7 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
// We redo this each tic to make savegame compatibility easier.
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
{
if (wp->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
continue;
mo2 = (mobj_t *)wp;
@@ -1916,7 +1916,7 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
// Find next waypoint
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
{
if (wp->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
continue;
mo2 = (mobj_t *)wp;
@@ -1955,7 +1955,7 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
{
if (wp->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
continue;
mo2 = (mobj_t *)wp;
@@ -1992,7 +1992,7 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
{
if (wp->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
continue;
mo2 = (mobj_t *)wp;
@@ -2357,7 +2357,7 @@ INT32 EV_DoPolyObjRotate(polyrotdata_t *prdata)
// create a new thinker
th = Z_Malloc(sizeof(polyrotate_t), PU_LEVSPEC, NULL);
th->thinker.function = (actionf_p1)T_PolyObjRotate;
th->thinker.function.acp1 = (actionf_p1)T_PolyObjRotate;
PolyObj_AddThinker(&th->thinker);
po->thinker = &th->thinker;
@@ -2425,7 +2425,7 @@ INT32 EV_DoPolyObjMove(polymovedata_t *pmdata)
// create a new thinker
th = Z_Malloc(sizeof(polymove_t), PU_LEVSPEC, NULL);
th->thinker.function = (actionf_p1)T_PolyObjMove;
th->thinker.function.acp1 = (actionf_p1)T_PolyObjMove;
PolyObj_AddThinker(&th->thinker);
po->thinker = &th->thinker;
@@ -2491,7 +2491,7 @@ INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
// create a new thinker
th = Z_Malloc(sizeof(polywaypoint_t), PU_LEVSPEC, NULL);
th->thinker.function = (actionf_p1)T_PolyObjWaypoint;
th->thinker.function.acp1 = (actionf_p1)T_PolyObjWaypoint;
PolyObj_AddThinker(&th->thinker);
po->thinker = &th->thinker;
@@ -2512,7 +2512,7 @@ INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
// Find the first waypoint we need to use
for (wp = thinkercap.next; wp != &thinkercap; wp = wp->next)
{
if (wp->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
if (wp->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
continue;
mo2 = (mobj_t *)wp;
@@ -2627,7 +2627,7 @@ static void Polyobj_doSlideDoor(polyobj_t *po, polydoordata_t *doordata)
// allocate and add a new slide door thinker
th = Z_Malloc(sizeof(polyslidedoor_t), PU_LEVSPEC, NULL);
th->thinker.function = (actionf_p1)T_PolyDoorSlide;
th->thinker.function.acp1 = (actionf_p1)T_PolyDoorSlide;
PolyObj_AddThinker(&th->thinker);
// point the polyobject to this thinker
@@ -2678,7 +2678,7 @@ static void Polyobj_doSwingDoor(polyobj_t *po, polydoordata_t *doordata)
// allocate and add a new swing door thinker
th = Z_Malloc(sizeof(polyswingdoor_t), PU_LEVSPEC, NULL);
th->thinker.function = (actionf_p1)T_PolyDoorSwing;
th->thinker.function.acp1 = (actionf_p1)T_PolyDoorSwing;
PolyObj_AddThinker(&th->thinker);
// point the polyobject to this thinker
@@ -2763,7 +2763,7 @@ INT32 EV_DoPolyObjDisplace(polydisplacedata_t *prdata)
// create a new thinker
th = Z_Malloc(sizeof(polydisplace_t), PU_LEVSPEC, NULL);
th->thinker.function = (actionf_p1)T_PolyObjDisplace;
th->thinker.function.acp1 = (actionf_p1)T_PolyObjDisplace;
PolyObj_AddThinker(&th->thinker);
po->thinker = &th->thinker;
@@ -2867,7 +2867,7 @@ INT32 EV_DoPolyObjFlag(line_t *pfdata)
// create a new thinker
th = Z_Malloc(sizeof(polymove_t), PU_LEVSPEC, NULL);
th->thinker.function = (actionf_p1)T_PolyObjFlag;
th->thinker.function.acp1 = (actionf_p1)T_PolyObjFlag;
PolyObj_AddThinker(&th->thinker);
po->thinker = &th->thinker;
+67 -67
View File
@@ -1677,194 +1677,194 @@ static void P_NetArchiveThinkers(savebuffer_t *save)
// save off the current thinkers
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function == (actionf_p1)P_RemoveThinkerDelayed)
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
continue;
numsaved++;
if (th->function == (actionf_p1)P_MobjThinker)
if (th->function.acp1 == (actionf_p1)P_MobjThinker)
{
SaveMobjThinker(save, th, tc_mobj);
continue;
}
else if (th->function == (actionf_p1)T_MoveCeiling)
else if (th->function.acp1 == (actionf_p1)T_MoveCeiling)
{
SaveCeilingThinker(save, th, tc_ceiling);
continue;
}
else if (th->function == (actionf_p1)T_CrushCeiling)
else if (th->function.acp1 == (actionf_p1)T_CrushCeiling)
{
SaveCeilingThinker(save, th, tc_crushceiling);
continue;
}
else if (th->function == (actionf_p1)T_MoveFloor)
else if (th->function.acp1 == (actionf_p1)T_MoveFloor)
{
SaveFloormoveThinker(save, th, tc_floor);
continue;
}
else if (th->function == (actionf_p1)T_LightningFlash)
else if (th->function.acp1 == (actionf_p1)T_LightningFlash)
{
SaveLightflashThinker(save, th, tc_flash);
continue;
}
else if (th->function == (actionf_p1)T_StrobeFlash)
else if (th->function.acp1 == (actionf_p1)T_StrobeFlash)
{
SaveStrobeThinker(save, th, tc_strobe);
continue;
}
else if (th->function == (actionf_p1)T_Glow)
else if (th->function.acp1 == (actionf_p1)T_Glow)
{
SaveGlowThinker(save, th, tc_glow);
continue;
}
else if (th->function == (actionf_p1)T_FireFlicker)
else if (th->function.acp1 == (actionf_p1)T_FireFlicker)
{
SaveFireflickerThinker(save, th, tc_fireflicker);
continue;
}
else if (th->function == (actionf_p1)T_MoveElevator)
else if (th->function.acp1 == (actionf_p1)T_MoveElevator)
{
SaveElevatorThinker(save, th, tc_elevator);
continue;
}
else if (th->function == (actionf_p1)T_ContinuousFalling)
else if (th->function.acp1 == (actionf_p1)T_ContinuousFalling)
{
SaveSpecialLevelThinker(save, th, tc_continuousfalling);
continue;
}
else if (th->function == (actionf_p1)T_ThwompSector)
else if (th->function.acp1 == (actionf_p1)T_ThwompSector)
{
SaveSpecialLevelThinker(save, th, tc_thwomp);
continue;
}
else if (th->function == (actionf_p1)T_NoEnemiesSector)
else if (th->function.acp1 == (actionf_p1)T_NoEnemiesSector)
{
SaveSpecialLevelThinker(save, th, tc_noenemies);
continue;
}
else if (th->function == (actionf_p1)T_EachTimeThinker)
else if (th->function.acp1 == (actionf_p1)T_EachTimeThinker)
{
SaveSpecialLevelThinker(save, th, tc_eachtime);
continue;
}
else if (th->function == (actionf_p1)T_RaiseSector)
else if (th->function.acp1 == (actionf_p1)T_RaiseSector)
{
SaveSpecialLevelThinker(save, th, tc_raisesector);
continue;
}
else if (th->function == (actionf_p1)T_CameraScanner)
else if (th->function.acp1 == (actionf_p1)T_CameraScanner)
{
SaveElevatorThinker(save, th, tc_camerascanner);
continue;
}
else if (th->function == (actionf_p1)T_Scroll)
else if (th->function.acp1 == (actionf_p1)T_Scroll)
{
SaveScrollThinker(save, th, tc_scroll);
continue;
}
else if (th->function == (actionf_p1)T_Friction)
else if (th->function.acp1 == (actionf_p1)T_Friction)
{
SaveFrictionThinker(save, th, tc_friction);
continue;
}
else if (th->function == (actionf_p1)T_Pusher)
else if (th->function.acp1 == (actionf_p1)T_Pusher)
{
SavePusherThinker(save, th, tc_pusher);
continue;
}
else if (th->function == (actionf_p1)T_BounceCheese)
else if (th->function.acp1 == (actionf_p1)T_BounceCheese)
{
SaveSpecialLevelThinker(save, th, tc_bouncecheese);
continue;
}
else if (th->function == (actionf_p1)T_StartCrumble)
else if (th->function.acp1 == (actionf_p1)T_StartCrumble)
{
SaveElevatorThinker(save, th, tc_startcrumble);
continue;
}
else if (th->function == (actionf_p1)T_MarioBlock)
else if (th->function.acp1 == (actionf_p1)T_MarioBlock)
{
SaveSpecialLevelThinker(save, th, tc_marioblock);
continue;
}
else if (th->function == (actionf_p1)T_MarioBlockChecker)
else if (th->function.acp1 == (actionf_p1)T_MarioBlockChecker)
{
SaveSpecialLevelThinker(save, th, tc_marioblockchecker);
continue;
}
else if (th->function == (actionf_p1)T_SpikeSector)
else if (th->function.acp1 == (actionf_p1)T_SpikeSector)
{
SaveSpecialLevelThinker(save, th, tc_spikesector);
continue;
}
else if (th->function == (actionf_p1)T_FloatSector)
else if (th->function.acp1 == (actionf_p1)T_FloatSector)
{
SaveSpecialLevelThinker(save, th, tc_floatsector);
continue;
}
else if (th->function == (actionf_p1)T_BridgeThinker)
else if (th->function.acp1 == (actionf_p1)T_BridgeThinker)
{
SaveSpecialLevelThinker(save, th, tc_bridgethinker);
continue;
}
else if (th->function == (actionf_p1)T_LaserFlash)
else if (th->function.acp1 == (actionf_p1)T_LaserFlash)
{
SaveLaserThinker(save, th, tc_laserflash);
continue;
}
else if (th->function == (actionf_p1)T_LightFade)
else if (th->function.acp1 == (actionf_p1)T_LightFade)
{
SaveLightlevelThinker(save, th, tc_lightfade);
continue;
}
else if (th->function == (actionf_p1)T_ExecutorDelay)
else if (th->function.acp1 == (actionf_p1)T_ExecutorDelay)
{
SaveExecutorThinker(save, th, tc_executor);
continue;
}
else if (th->function == (actionf_p1)T_Disappear)
else if (th->function.acp1 == (actionf_p1)T_Disappear)
{
SaveDisappearThinker(save, th, tc_disappear);
continue;
}
else if (th->function == (actionf_p1)T_PolyObjRotate)
else if (th->function.acp1 == (actionf_p1)T_PolyObjRotate)
{
SavePolyrotatetThinker(save, th, tc_polyrotate);
continue;
}
else if (th->function == (actionf_p1)T_PolyObjMove)
else if (th->function.acp1 == (actionf_p1)T_PolyObjMove)
{
SavePolymoveThinker(save, th, tc_polymove);
continue;
}
else if (th->function == (actionf_p1)T_PolyObjWaypoint)
else if (th->function.acp1 == (actionf_p1)T_PolyObjWaypoint)
{
SavePolywaypointThinker(save, th, tc_polywaypoint);
continue;
}
else if (th->function == (actionf_p1)T_PolyDoorSlide)
else if (th->function.acp1 == (actionf_p1)T_PolyDoorSlide)
{
SavePolyslidedoorThinker(save, th, tc_polyslidedoor);
continue;
}
else if (th->function == (actionf_p1)T_PolyDoorSwing)
else if (th->function.acp1 == (actionf_p1)T_PolyDoorSwing)
{
SavePolyswingdoorThinker(save, th, tc_polyswingdoor);
continue;
}
else if (th->function == (actionf_p1)T_PolyObjFlag)
else if (th->function.acp1 == (actionf_p1)T_PolyObjFlag)
{
SavePolymoveThinker(save, th, tc_polyflag);
continue;
}
else if (th->function == (actionf_p1)T_PolyObjDisplace)
else if (th->function.acp1 == (actionf_p1)T_PolyObjDisplace)
{
SavePolydisplaceThinker(save, th, tc_polydisplace);
continue;
}
#ifdef PARANOIA
else if (th->function != (actionf_p1)P_RemoveThinkerDelayed) // wait garbage collection
I_Error("unknown thinker type %p", th->function);
else if (th->function.acp1 != (actionf_p1)P_RemoveThinkerDelayed) // wait garbage collection
I_Error("unknown thinker type %p", th->function.acp1);
#endif
}
@@ -1884,7 +1884,7 @@ mobj_t *P_FindNewPosition(UINT32 oldposition)
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mobj = (mobj_t *)th;
@@ -1983,7 +1983,7 @@ static void LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
mobj = AllocMobj();
// declare this as a valid mobj as soon as possible.
mobj->thinker.function = thinker;
mobj->thinker.function.acp1 = thinker;
mobj->z = z;
mobj->floorz = floorz;
@@ -2216,7 +2216,7 @@ static void LoadSpecialLevelThinker(savebuffer_t *save, actionf_p1 thinker, UINT
{
levelspecthink_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
size_t i;
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
for (i = 0; i < 16; i++)
{
ht->vars[i] = READFIXED(save->p); //var[16]
@@ -2244,7 +2244,7 @@ static void LoadSpecialLevelThinker(savebuffer_t *save, actionf_p1 thinker, UINT
static void LoadCeilingThinker(savebuffer_t *save, actionf_p1 thinker)
{
ceiling_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->type = READUINT8(save->p);
ht->sector = LoadSector(READUINT32(save->p));
ht->bottomheight = READFIXED(save->p);
@@ -2273,7 +2273,7 @@ static void LoadCeilingThinker(savebuffer_t *save, actionf_p1 thinker)
static void LoadFloormoveThinker(savebuffer_t *save, actionf_p1 thinker)
{
floormove_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->type = READUINT8(save->p);
ht->crush = READUINT8(save->p);
ht->sector = LoadSector(READUINT32(save->p));
@@ -2297,7 +2297,7 @@ static void LoadFloormoveThinker(savebuffer_t *save, actionf_p1 thinker)
static void LoadLightflashThinker(savebuffer_t *save, actionf_p1 thinker)
{
lightflash_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->sector = LoadSector(READUINT32(save->p));
ht->maxlight = READINT32(save->p);
ht->minlight = READINT32(save->p);
@@ -2314,7 +2314,7 @@ static void LoadLightflashThinker(savebuffer_t *save, actionf_p1 thinker)
static void LoadStrobeThinker(savebuffer_t *save, actionf_p1 thinker)
{
strobe_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->sector = LoadSector(READUINT32(save->p));
ht->count = READINT32(save->p);
ht->minlight = READINT32(save->p);
@@ -2334,7 +2334,7 @@ static void LoadStrobeThinker(savebuffer_t *save, actionf_p1 thinker)
static void LoadGlowThinker(savebuffer_t *save, actionf_p1 thinker)
{
glow_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->sector = LoadSector(READUINT32(save->p));
ht->minlight = READINT32(save->p);
ht->maxlight = READINT32(save->p);
@@ -2353,7 +2353,7 @@ static void LoadGlowThinker(savebuffer_t *save, actionf_p1 thinker)
static void LoadFireflickerThinker(savebuffer_t *save, actionf_p1 thinker)
{
fireflicker_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->sector = LoadSector(READUINT32(save->p));
ht->count = READINT32(save->p);
ht->resetcount = READINT32(save->p);
@@ -2372,7 +2372,7 @@ static void LoadFireflickerThinker(savebuffer_t *save, actionf_p1 thinker)
static void LoadElevatorThinker(savebuffer_t *save, actionf_p1 thinker, UINT8 floorOrCeiling)
{
elevator_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->type = READUINT8(save->p);
ht->sector = LoadSector(READUINT32(save->p));
ht->actionsector = LoadSector(READUINT32(save->p));
@@ -2410,7 +2410,7 @@ static void LoadElevatorThinker(savebuffer_t *save, actionf_p1 thinker, UINT8 fl
static void LoadScrollThinker(savebuffer_t *save, actionf_p1 thinker)
{
scroll_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->dx = READFIXED(save->p);
ht->dy = READFIXED(save->p);
ht->affectee = READINT32(save->p);
@@ -2432,7 +2432,7 @@ static void LoadScrollThinker(savebuffer_t *save, actionf_p1 thinker)
static inline void LoadFrictionThinker(savebuffer_t *save, actionf_p1 thinker)
{
friction_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->friction = READINT32(save->p);
ht->movefactor = READINT32(save->p);
ht->affectee = READINT32(save->p);
@@ -2449,7 +2449,7 @@ static inline void LoadFrictionThinker(savebuffer_t *save, actionf_p1 thinker)
static void LoadPusherThinker(savebuffer_t *save, actionf_p1 thinker)
{
pusher_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->type = READUINT8(save->p);
ht->x_mag = READINT32(save->p);
ht->y_mag = READINT32(save->p);
@@ -2476,7 +2476,7 @@ static inline void LoadLaserThinker(savebuffer_t *save, actionf_p1 thinker)
{
laserthink_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ffloor_t *rover = NULL;
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->sector = LoadSector(READUINT32(save->p));
ht->sec = LoadSector(READUINT32(save->p));
ht->sourceline = LoadLine(READUINT32(save->p));
@@ -2495,7 +2495,7 @@ static inline void LoadLaserThinker(savebuffer_t *save, actionf_p1 thinker)
FUNCINLINE static ATTRINLINE void LoadLightlevelThinker(savebuffer_t *save, actionf_p1 thinker)
{
lightlevel_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->sector = LoadSector(READUINT32(save->p));
ht->destlevel = READINT32(save->p);
ht->speed = READINT32(save->p);
@@ -2512,7 +2512,7 @@ FUNCINLINE static ATTRINLINE void LoadLightlevelThinker(savebuffer_t *save, acti
static inline void LoadExecutorThinker(savebuffer_t *save, actionf_p1 thinker)
{
executor_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->line = LoadLine(READUINT32(save->p));
ht->caller = LoadMobj(READUINT32(save->p));
ht->sector = LoadSector(READUINT32(save->p));
@@ -2528,7 +2528,7 @@ static inline void LoadExecutorThinker(savebuffer_t *save, actionf_p1 thinker)
static inline void LoadDisappearThinker(savebuffer_t *save, actionf_p1 thinker)
{
disappear_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->appeartime = READUINT32(save->p);
ht->disappeartime = READUINT32(save->p);
ht->offset = READUINT32(save->p);
@@ -2547,7 +2547,7 @@ static inline void LoadDisappearThinker(savebuffer_t *save, actionf_p1 thinker)
static inline void LoadPolyrotatetThinker(savebuffer_t *save, actionf_p1 thinker)
{
polyrotate_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->polyObjNum = READINT32(save->p);
ht->speed = READINT32(save->p);
ht->distance = READINT32(save->p);
@@ -2563,7 +2563,7 @@ static inline void LoadPolyrotatetThinker(savebuffer_t *save, actionf_p1 thinker
static void LoadPolymoveThinker(savebuffer_t *save, actionf_p1 thinker)
{
polymove_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->polyObjNum = READINT32(save->p);
ht->speed = READINT32(save->p);
ht->momx = READFIXED(save->p);
@@ -2581,7 +2581,7 @@ static void LoadPolymoveThinker(savebuffer_t *save, actionf_p1 thinker)
static inline void LoadPolywaypointThinker(savebuffer_t *save, actionf_p1 thinker)
{
polywaypoint_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->polyObjNum = READINT32(save->p);
ht->speed = READINT32(save->p);
ht->sequence = READINT32(save->p);
@@ -2605,7 +2605,7 @@ static inline void LoadPolywaypointThinker(savebuffer_t *save, actionf_p1 thinke
static inline void LoadPolyslidedoorThinker(savebuffer_t *save, actionf_p1 thinker)
{
polyslidedoor_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->polyObjNum = READINT32(save->p);
ht->delay = READINT32(save->p);
ht->delayCount = READINT32(save->p);
@@ -2630,7 +2630,7 @@ static inline void LoadPolyslidedoorThinker(savebuffer_t *save, actionf_p1 think
static inline void LoadPolyswingdoorThinker(savebuffer_t *save, actionf_p1 thinker)
{
polyswingdoor_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->polyObjNum = READINT32(save->p);
ht->delay = READINT32(save->p);
ht->delayCount = READINT32(save->p);
@@ -2650,7 +2650,7 @@ static inline void LoadPolyswingdoorThinker(savebuffer_t *save, actionf_p1 think
static inline void LoadPolydisplaceThinker(savebuffer_t *save, actionf_p1 thinker)
{
polydisplace_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL);
ht->thinker.function = thinker;
ht->thinker.function.acp1 = thinker;
ht->polyObjNum = READINT32(save->p);
ht->controlSector = LoadSector(READUINT32(save->p));
ht->dx = READFIXED(save->p);
@@ -2680,7 +2680,7 @@ static void P_NetUnArchiveThinkers(savebuffer_t *save)
{
next = currentthinker->next;
if (currentthinker->function == (actionf_p1)P_MobjThinker)
if (currentthinker->function.acp1 == (actionf_p1)P_MobjThinker)
P_RemoveSavegameMobj((mobj_t *)currentthinker); // item isn't saved, don't remove it
else
{
@@ -2874,7 +2874,7 @@ static void P_NetUnArchiveThinkers(savebuffer_t *save)
for (currentthinker = thinkercap.next; currentthinker != &thinkercap;
currentthinker = currentthinker->next)
{
if (currentthinker->function != (actionf_p1)T_ExecutorDelay)
if (currentthinker->function.acp1 != (actionf_p1)T_ExecutorDelay)
continue;
delay = (void *)currentthinker;
@@ -2989,7 +2989,7 @@ static inline void P_FinishMobjs(void)
for (currentthinker = thinkercap.next; currentthinker != &thinkercap;
currentthinker = currentthinker->next)
{
if (currentthinker->function != (actionf_p1)P_MobjThinker)
if (currentthinker->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mobj = (mobj_t *)currentthinker;
@@ -3014,7 +3014,7 @@ static void P_RelinkPointers(void)
for (currentthinker = thinkercap.next; currentthinker != &thinkercap;
currentthinker = currentthinker->next)
{
if (currentthinker->function != (actionf_p1)P_MobjThinker)
if (currentthinker->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mobj = (mobj_t *)currentthinker;
@@ -3431,7 +3431,7 @@ void P_SaveNetGame(savebuffer_t *save, boolean resending)
{
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mobj = (mobj_t *)th;
+1 -1
View File
@@ -3071,7 +3071,7 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
if (!fromnetsave) // uglier hack
{ // to make a newly loaded level start on the second frame.
INT32 buf = gametic % TICQUEUE;
INT32 buf = gametic % BACKUPTICS;
for (i = 0; i < MAXPLAYERS; i++)
{
+33 -34
View File
@@ -1302,7 +1302,7 @@ static void P_AddExecutorDelay(line_t *line, mobj_t *mobj, sector_t *sector)
e = Z_Calloc(sizeof (*e), PU_LEVSPEC, NULL);
e->thinker.function = (actionf_p1)T_ExecutorDelay;
e->thinker.function.acp1 = (actionf_p1)T_ExecutorDelay;
e->line = line;
e->sector = sector;
e->timer = (line->backsector->ceilingheight>>FRACBITS)+(line->backsector->floorheight>>FRACBITS);
@@ -2602,7 +2602,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)T_Scroll)
if (th->function.acp1 != (actionf_p1)T_Scroll)
continue;
scroller = (scroll_t *)th;
@@ -2937,7 +2937,7 @@ void P_SetupSignExit(player_t *player)
// spin all signposts in the level then.
for (think = thinkercap.next; think != &thinkercap; think = think->next)
{
if (think->function != (actionf_p1)P_MobjThinker)
if (think->function.acp1 != (actionf_p1)P_MobjThinker)
continue; // not a mobj thinker
thing = (mobj_t *)think;
@@ -2986,7 +2986,7 @@ boolean P_IsFlagAtBase(mobjtype_t flag)
for (think = thinkercap.next; think != &thinkercap; think = think->next)
{
if (think->function != (actionf_p1)P_MobjThinker)
if (think->function.acp1 != (actionf_p1)P_MobjThinker)
continue; // not a mobj thinker
mo = (mobj_t *)think;
@@ -3419,7 +3419,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
// The chimps are my friends.. heeheeheheehehee..... - LouisJM
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
@@ -3760,7 +3760,7 @@ DoneSection2:
// to find the first waypoint
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
@@ -3833,7 +3833,7 @@ DoneSection2:
// to find the last waypoint
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
@@ -3889,7 +3889,6 @@ DoneSection2:
{
if (!playeringame[i] || players[i].spectator)
continue;
nump++;
}
@@ -4045,7 +4044,7 @@ DoneSection2:
// to find the first waypoint
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
@@ -4083,7 +4082,7 @@ DoneSection2:
// Find waypoint before this one (waypointlow)
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
@@ -4110,7 +4109,7 @@ DoneSection2:
// Find waypoint after this one (waypointhigh)
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
@@ -4800,7 +4799,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
break;
// Should this FOF have spikeness?
if (th->function == (actionf_p1)T_SpikeSector)
if (th->function.acp1 == (actionf_p1)T_SpikeSector)
{
lst = (levelspecthink_t *)th;
@@ -4808,7 +4807,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
P_AddSpikeThinker(sec, (INT32)sec2num);
}
// Should this FOF have friction?
else if(th->function == (actionf_p1)T_Friction)
else if(th->function.acp1 == (actionf_p1)T_Friction)
{
f = (friction_t *)th;
@@ -4816,7 +4815,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
Add_Friction(f->friction, f->movefactor, (INT32)(sec-sectors), f->affectee);
}
// Should this FOF have wind/current/pusher?
else if(th->function == (actionf_p1)T_Pusher)
else if(th->function.acp1 == (actionf_p1)T_Pusher)
{
p = (pusher_t *)th;
@@ -4907,7 +4906,7 @@ static void P_AddSpikeThinker(sector_t *sec, INT32 referrer)
spikes = Z_Calloc(sizeof (*spikes), PU_LEVSPEC, NULL);
P_AddThinker(&spikes->thinker);
spikes->thinker.function = (actionf_p1)T_SpikeSector;
spikes->thinker.function.acp1 = (actionf_p1)T_SpikeSector;
spikes->sector = sec;
spikes->vars[0] = referrer;
@@ -4929,7 +4928,7 @@ static void P_AddFloatThinker(sector_t *sec, INT32 tag, line_t *sourceline)
floater = Z_Calloc(sizeof (*floater), PU_LEVSPEC, NULL);
P_AddThinker(&floater->thinker);
floater->thinker.function = (actionf_p1)T_FloatSector;
floater->thinker.function.acp1 = (actionf_p1)T_FloatSector;
floater->sector = sec;
floater->vars[0] = tag;
@@ -4958,7 +4957,7 @@ static void P_AddBlockThinker(sector_t *sec, line_t *sourceline)
block = Z_Calloc(sizeof (*block), PU_LEVSPEC, NULL);
P_AddThinker(&block->thinker);
block->thinker.function = (actionf_p1)T_MarioBlockChecker;
block->thinker.function.acp1 = (actionf_p1)T_MarioBlockChecker;
block->sourceline = sourceline;
block->sector = sec;
@@ -4987,7 +4986,7 @@ static void P_AddRaiseThinker(sector_t *sec, line_t *sourceline)
raise = Z_Calloc(sizeof (*raise), PU_LEVSPEC, NULL);
P_AddThinker(&raise->thinker);
raise->thinker.function = (actionf_p1)T_RaiseSector;
raise->thinker.function.acp1 = (actionf_p1)T_RaiseSector;
if (sourceline->flags & ML_BLOCKMONSTERS)
raise->vars[0] = 1;
@@ -5030,7 +5029,7 @@ static void P_AddOldAirbob(sector_t *sec, line_t *sourceline, boolean noadjust)
airbob = Z_Calloc(sizeof (*airbob), PU_LEVSPEC, NULL);
P_AddThinker(&airbob->thinker);
airbob->thinker.function = (actionf_p1)T_RaiseSector;
airbob->thinker.function.acp1 = (actionf_p1)T_RaiseSector;
// set up the fields
airbob->sector = sec;
@@ -5095,7 +5094,7 @@ static inline void P_AddThwompThinker(sector_t *sec, sector_t *actionsector, lin
thwomp = Z_Calloc(sizeof (*thwomp), PU_LEVSPEC, NULL);
P_AddThinker(&thwomp->thinker);
thwomp->thinker.function = (actionf_p1)T_ThwompSector;
thwomp->thinker.function.acp1 = (actionf_p1)T_ThwompSector;
// set up the fields according to the type of elevator action
thwomp->sector = sec;
@@ -5136,7 +5135,7 @@ static inline void P_AddNoEnemiesThinker(sector_t *sec, line_t *sourceline)
nobaddies = Z_Calloc(sizeof (*nobaddies), PU_LEVSPEC, NULL);
P_AddThinker(&nobaddies->thinker);
nobaddies->thinker.function = (actionf_p1)T_NoEnemiesSector;
nobaddies->thinker.function.acp1 = (actionf_p1)T_NoEnemiesSector;
nobaddies->sector = sec;
nobaddies->sourceline = sourceline;
@@ -5158,7 +5157,7 @@ static inline void P_AddEachTimeThinker(sector_t *sec, line_t *sourceline)
eachtime = Z_Calloc(sizeof (*eachtime), PU_LEVSPEC, NULL);
P_AddThinker(&eachtime->thinker);
eachtime->thinker.function = (actionf_p1)T_EachTimeThinker;
eachtime->thinker.function.acp1 = (actionf_p1)T_EachTimeThinker;
eachtime->sector = sec;
eachtime->sourceline = sourceline;
@@ -5180,7 +5179,7 @@ static inline void P_AddCameraScanner(sector_t *sourcesec, sector_t *actionsecto
elevator = Z_Calloc(sizeof (*elevator), PU_LEVSPEC, NULL);
P_AddThinker(&elevator->thinker);
elevator->thinker.function = (actionf_p1)T_CameraScanner;
elevator->thinker.function.acp1 = (actionf_p1)T_CameraScanner;
elevator->type = elevateBounce;
// set up the fields according to the type of elevator action
@@ -5269,7 +5268,7 @@ static inline void EV_AddLaserThinker(sector_t *sec, sector_t *sec2, line_t *lin
P_AddThinker(&flash->thinker);
flash->thinker.function = (actionf_p1)T_LaserFlash;
flash->thinker.function.acp1 = (actionf_p1)T_LaserFlash;
flash->ffloor = ffloor;
flash->sector = sec; // For finding mobjs
flash->sec = sec2;
@@ -5383,11 +5382,11 @@ void P_SpawnSpecials(INT32 fromnetsave, boolean reloadinggamestate)
// Firstly, find out how many there are in each sector
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function == (actionf_p1)T_SpikeSector)
if (th->function.acp1 == (actionf_p1)T_SpikeSector)
secthinkers[((levelspecthink_t *)th)->sector - sectors].count++;
else if (th->function == (actionf_p1)T_Friction)
else if (th->function.acp1 == (actionf_p1)T_Friction)
secthinkers[((friction_t *)th)->affectee].count++;
else if (th->function == (actionf_p1)T_Pusher)
else if (th->function.acp1 == (actionf_p1)T_Pusher)
secthinkers[((pusher_t *)th)->affectee].count++;
}
@@ -5405,11 +5404,11 @@ void P_SpawnSpecials(INT32 fromnetsave, boolean reloadinggamestate)
{
size_t secnum = (size_t)-1;
if (th->function == (actionf_p1)T_SpikeSector)
if (th->function.acp1 == (actionf_p1)T_SpikeSector)
secnum = ((levelspecthink_t *)th)->sector - sectors;
else if (th->function == (actionf_p1)T_Friction)
else if (th->function.acp1 == (actionf_p1)T_Friction)
secnum = ((friction_t *)th)->affectee;
else if (th->function == (actionf_p1)T_Pusher)
else if (th->function.acp1 == (actionf_p1)T_Pusher)
secnum = ((pusher_t *)th)->affectee;
if (secnum != (size_t)-1)
@@ -6633,7 +6632,7 @@ void T_Scroll(scroll_t *s)
static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT32 affectee, INT32 accel, INT32 exclusive)
{
scroll_t *s = Z_Calloc(sizeof *s, PU_LEVSPEC, NULL);
s->thinker.function = (actionf_p1)T_Scroll;
s->thinker.function.acp1 = (actionf_p1)T_Scroll;
s->type = type;
s->dx = dx;
s->dy = dy;
@@ -6803,7 +6802,7 @@ static void Add_MasterDisappearer(tic_t appeartime, tic_t disappeartime, tic_t o
{
disappear_t *d = Z_Malloc(sizeof *d, PU_LEVSPEC, NULL);
d->thinker.function = (actionf_p1)T_Disappear;
d->thinker.function.acp1 = (actionf_p1)T_Disappear;
d->appeartime = appeartime;
d->disappeartime = disappeartime;
d->offset = offset;
@@ -6888,7 +6887,7 @@ static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32
{
friction_t *f = Z_Calloc(sizeof *f, PU_LEVSPEC, NULL);
f->thinker.function = (actionf_p1)T_Friction;
f->thinker.function.acp1 = (actionf_p1)T_Friction;
f->friction = friction;
f->movefactor = movefactor;
f->affectee = affectee;
@@ -7043,7 +7042,7 @@ static void Add_Pusher(pushertype_e type, fixed_t x_mag, fixed_t y_mag, mobj_t *
{
pusher_t *p = Z_Calloc(sizeof *p, PU_LEVSPEC, NULL);
p->thinker.function = (actionf_p1)T_Pusher;
p->thinker.function.acp1 = (actionf_p1)T_Pusher;
p->source = source;
p->type = type;
p->x_mag = x_mag>>FRACBITS;
+13 -17
View File
@@ -115,7 +115,7 @@ void Command_Numthinkers_f(void)
for (think = listtype->next; think != listtype; think = think->next)
{
if (think->function != action)
if (think->function.acp1 != action)
continue;
count++;
@@ -152,7 +152,7 @@ void Command_CountMobjs_f(void)
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
if (((mobj_t *)th)->type == i)
@@ -172,7 +172,7 @@ void Command_CountMobjs_f(void)
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
if (((mobj_t *)th)->type == i)
@@ -207,7 +207,7 @@ void P_AddThinker(thinker_t *thinker)
thinker->references = 0; // killough 11/98: init reference counter to 0
thinker->cachable = (thinker->function == (actionf_p1)P_MobjThinker);
thinker->cachable = (thinker->function.acp1 == (actionf_p1)P_MobjThinker);
#ifdef PARANOIA
thinker->debug_mobjtype = MT_NULL;
#endif
@@ -235,7 +235,7 @@ void P_AddPrecipThinker(thinker_t *thinker)
#ifdef PARANOIA
static const char *MobjTypeName(const mobj_t *mobj)
{
actionf_p1 p1 = mobj->thinker.function;
actionf_p1 p1 = mobj->thinker.function.acp1;
if (p1 == (actionf_p1)P_MobjThinker)
{
@@ -254,7 +254,7 @@ static const char *MobjTypeName(const mobj_t *mobj)
static const char *MobjThinkerName(const mobj_t *mobj)
{
actionf_p1 p1 = mobj->thinker.function;
actionf_p1 p1 = mobj->thinker.function.acp1;
if (p1 == (actionf_p1)P_MobjThinker)
{
@@ -371,7 +371,7 @@ void P_UnlinkThinker(thinker_t *thinker)
void P_RemoveThinker(thinker_t *thinker)
{
LUA_InvalidateUserdata(thinker);
thinker->function = (actionf_p1)P_RemoveThinkerDelayed;
thinker->function.acp1 = (actionf_p1)P_RemoveThinkerDelayed;
}
/*
@@ -455,9 +455,9 @@ static inline void P_RunThinkers(void)
for (currentthinker = thinkercap.next; currentthinker != &thinkercap; currentthinker = currentthinker->next)
{
#ifdef PARANOIA
I_Assert(currentthinker->function != NULL);
I_Assert(currentthinker->function.acp1 != NULL);
#endif
currentthinker->function(currentthinker);
currentthinker->function.acp1(currentthinker);
}
}
@@ -610,7 +610,7 @@ static inline void P_ResetSpriteStuff(void)
{
mobj_t *mo;
if (th->function != (actionf_p1)P_MobjThinker) // not a mobj
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // not a mobj
continue;
mo = (mobj_t *)th;
@@ -734,10 +734,8 @@ void P_Ticker(boolean run)
PS_START_TIMING(ps_playerthink_time);
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !P_MobjWasRemoved(players[i].mo))
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
P_PlayerThink(&players[i]);
}
PS_STOP_TIMING(ps_playerthink_time);
}
@@ -756,10 +754,8 @@ void P_Ticker(boolean run)
// Run any "after all the other thinkers" stuff
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !P_MobjWasRemoved(players[i].mo))
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
P_PlayerAfterThink(&players[i]);
}
// Apply rumble to local players
if (!demo.playback)
@@ -961,7 +957,7 @@ void P_PreTicker(INT32 frames)
if (!playeringame[i])
continue;
if (P_MobjWasRemoved(players[i].mo))
if (!players[i].mo || P_MobjWasRemoved(players[i].mo))
continue;
P_PlayerAfterThink(&players[i]);
+11 -15
View File
@@ -552,13 +552,9 @@ static UINT8 getPlayerPos(player_t *player)
{
UINT8 pos = 1;
for (UINT8 i = 0; i < MAXPLAYERS; ++i)
{
if (!playeringame[i] || players[i].spectator)
continue;
if (players[i].marescore > player->marescore)
++pos;
for (int i = 0; i < MAXPLAYERS; ++i) {
if (!playeringame[i] || players[i].spectator) continue;
if (players[i].marescore > player->marescore) ++pos;
}
return pos;
@@ -1068,7 +1064,7 @@ void P_SpawnShieldOrb(player_t *player)
// blaze through the thinkers to see if an orb already exists!
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
shieldobj = (mobj_t *)th;
@@ -1784,7 +1780,7 @@ void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range)
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
@@ -2510,7 +2506,7 @@ static void P_DoZoomTube(player_t *player)
// Find next waypoint
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker) // Not a mobj thinker
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
continue;
mo2 = (mobj_t *)th;
@@ -2600,7 +2596,7 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius)
for (think = thinkercap.next; think != &thinkercap; think = think->next)
{
if (think->function != (actionf_p1)P_MobjThinker)
if (think->function.acp1 != (actionf_p1)P_MobjThinker)
continue; // not a mobj thinker
mo = (mobj_t *)think;
@@ -2677,7 +2673,7 @@ boolean P_LookForEnemies(player_t *player)
for (think = thinkercap.next; think != &thinkercap; think = think->next)
{
if (think->function != (actionf_p1)P_MobjThinker)
if (think->function.acp1 != (actionf_p1)P_MobjThinker)
continue; // not a mobj thinker
mo = (mobj_t *)think;
@@ -2801,7 +2797,7 @@ void P_FindEmerald(void)
// to find all emeralds
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
@@ -4249,7 +4245,7 @@ static void P_CalcPostImg(player_t *player, camera_t *thiscam)
else
pviewheight = player->mo->z + player->viewheight;
if (player->awayviewtics && !P_MobjWasRemoved(player->awayviewmobj))
if (player->awayviewtics && player->awayviewmobj && !P_MobjWasRemoved(player->awayviewmobj))
{
sector = player->awayviewmobj->subsector->sector;
pviewheight = player->awayviewmobj->z + 20*FRACUNIT;
@@ -4780,7 +4776,7 @@ void P_PlayerThink(player_t *player)
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
+1 -1
View File
@@ -1865,7 +1865,7 @@ static void R_PrecacheLevelSprites(void)
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function != (actionf_p1)P_MobjThinker)
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
spritepresent[((mobj_t *)th)->sprite] = 1;
+1 -5
View File
@@ -66,9 +66,7 @@ static void Highreshudscale_OnChange(void)
static void SCR_ChangeFullscreen (void);
static CV_PossibleValue_t fullscreen_cons_t[] = {{0, "No"}, {1, "Yes"}, {2, "Borderless Window"}, {0, NULL}};
consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, fullscreen_cons_t, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, CV_YesNo, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t accuratefps_cons_t[] = {{0, "Inaccurate"}, {1, "Accurate"}, {0, NULL}};
consvar_t cv_accuratefps = {"fpssampling", "1", CV_SAVE, accuratefps_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -327,8 +325,6 @@ void SCR_SetDefaultMode(void)
void SCR_ChangeFullscreen(void)
{
#ifdef DIRECTFULLSCREEN
I_SetBorderlessWindow(); // Running this here so we can have borderless window at startup
// allow_fullscreen is set by VID_PrepareModeList
// it is used to prevent switching to fullscreen during startup
if (!allow_fullscreen)
+1 -8
View File
@@ -150,7 +150,7 @@ UINT8 graphics_started = 0; // Is used in console.c and screen.c
// To disable fullscreen at startup; is set in VID_PrepareModeList
boolean allow_fullscreen = false;
static SDL_bool disable_fullscreen = SDL_FALSE;
#define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)? 0: (cv_fullscreen.value == 1)
#define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)?0:cv_fullscreen.value
static SDL_bool disable_mouse = SDL_FALSE;
#define USE_MOUSEINPUT (!disable_mouse && cv_usemouse.value && havefocus)
#define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN)
@@ -1353,7 +1353,6 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
{
wasfullscreen = SDL_TRUE;
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
I_SetBorderlessWindow();
}
else // windowed mode
{
@@ -2158,10 +2157,4 @@ static void Impl_SetVsync(void)
#endif
}
void I_SetBorderlessWindow(void)
{
SDL_bool borderless = (cv_fullscreen.value == 2) ? SDL_FALSE : SDL_TRUE;
SDL_SetWindowBordered(window, borderless);
}
#endif
+5 -5
View File
@@ -80,7 +80,7 @@ write netcode into the sound code, OKAY?
#define GME_BASS 1.0f
#endif // HAVE_GME
//static UINT16 BUFFERSIZE = 2048;
static UINT16 SAMPLERATE = 44100;
@@ -710,7 +710,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
// play gme into stream
gme_play(gme, len/2, (short *)stream);
// Limiter to prevent music from being disorted with some formats
if (music_volume >= 18)
music_volume = 18;
@@ -726,7 +726,7 @@ static void mix_openmpt(void *udata, Uint8 *stream, int len)
{
int i;
short *p;
(void)udata;
if (!openmpt_mhandle || songpaused)
@@ -734,7 +734,7 @@ static void mix_openmpt(void *udata, Uint8 *stream, int len)
// Play module into stream
openmpt_module_read_interleaved_stereo(openmpt_mhandle, SAMPLERATE, cv_audbuffersize.value, (short *)stream);
// Limiter to prevent music from being disorted with some formats
if (music_volume >= 18)
music_volume = 18;
@@ -823,7 +823,7 @@ boolean I_SetSongSpeed(float speed)
#endif
#ifdef HAVE_OPENMPT
if (openmpt_mhandle)
{
{
if (speed > 4.0f)
speed = 4.0f; // Limit this to 4x to prevent crashing, stupid fix but... ~SteelT 27/9/19
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR < 5