Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 2211-rc1
  • 2212-pre1
  • 2212-pre2
  • 2212-pre3
  • 2212-rc1
  • 2213
  • 2214-pre1
  • 2214-pre2
  • 2214-pre3
  • 2214-pre4
  • 2_2_12
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • acs
  • action-args
  • alpha-fixes
  • any-resolution
  • appveyor
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • cleanup-opengl
  • cleanupmusic
  • clipmidtex
  • cmake-valgrind
  • crawlacommander-sprites
  • custom-map-names
  • custom-teams
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • delfile2
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • dynabsp
  • emblem-drawing
  • exchndl-xp-fix
  • extra-textures
  • few-kart-lua-changes
  • ffloorclip
  • fix-167
  • fix-cvar-conflicts
  • fix-opengl-parameter-crash
  • fix-opengl-shear-roll
  • flipfuncpointers
  • fof-lightlist-fixes
  • font-FUCK
  • frictionrefactor
  • fuck-macros-1
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • gametype-refactor
  • gametype-refactor-1
  • gametype-refactor-player-spawns
  • ghost-networking
  • gif-splitting
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-maxconditionsets
  • increase-packet-tics
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • just-in-case
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • levelstruct
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-change-gametype
  • lua-command-netids
  • lua-gfx-2
  • lua-gfx-sprites
  • lua-local
  • makefile-auto-mingw-gcc
  • makefile-tinkering
  • map-components-signedness-fixes
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.11
  • SRB2_release_2.2.12
  • SRB2_release_2.2.13
  • SRB2_release_2.2.15
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
142 results

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
  • Jisk/srb-2-beef-jerky
117 results
Select Git revision
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 2211-rc1
  • 2212-pre1
  • 2212-pre2
  • 2212-pre3
  • 2212-rc1
  • 2213
  • 2_2_12
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • acs
  • action-args
  • alpha-fixes
  • any-resolution
  • appveyor
  • better-player-states
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • camera-think-hook
  • cleanup-opengl
  • cleanupmusic
  • cmake-valgrind
  • crawlacommander-sprites
  • custom-map-names
  • custom-teams
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • delfile2
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • dynabsp
  • emblem-drawing
  • exchndl-xp-fix
  • expose-player-muted
  • few-kart-lua-changes
  • ffloorclip
  • fix-1215
  • fix-167
  • fix-cvar-conflicts
  • fix-equation-slopes-near-edges
  • fix-opengl-shear-roll
  • fix-player-ping-being-writeable
  • flipfuncpointers
  • fof-lightlist-fixes
  • font-FUCK
  • frictionrefactor
  • fuck-macros-1
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • gametype-refactor
  • gametype-refactor-1
  • gametype-refactor-player-spawns
  • ghost-networking
  • gif-splitting
  • gitlab-ci
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-packet-tics
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • levelstruct
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-change-gametype
  • lua-command-netids
  • lua-conditions
  • lua-debug-library
  • lua-gfx-2
  • lua-gfx-sprites
  • lua-local
  • makefile-auto-mingw-gcc
  • makefile-tinkering
  • map-components-signedness-fixes
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.11
  • SRB2_release_2.2.12
  • SRB2_release_2.2.13
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
141 results
Show changes
...@@ -44,15 +44,6 @@ typedef struct ...@@ -44,15 +44,6 @@ typedef struct
/// Number of bytes in doomdata to be sent /// Number of bytes in doomdata to be sent
INT16 datalength; INT16 datalength;
/// Info common to all nodes.
/// Console is always node 0.
INT16 numnodes;
/// Flag: 1 = send a backup tic in every packet.
INT16 extratics;
/// Number of "slots": the highest player number in use plus one.
INT16 numslots;
/// The packet data to be sent. /// The packet data to be sent.
char data[MAXPACKETLENGTH]; char data[MAXPACKETLENGTH];
} ATTRPACK doomcom_t; } ATTRPACK doomcom_t;
...@@ -61,6 +52,18 @@ typedef struct ...@@ -61,6 +52,18 @@ typedef struct
#pragma pack() #pragma pack()
#endif #endif
/** \brief Number of connected nodes.
*/
extern INT16 numnetnodes;
/** \brief Number of "slots": the highest player number in use plus one.
*/
extern INT16 numslots;
/** \brief Flag: 1 = send a backup tic in every packet.
*/
extern INT16 extratics;
extern doomcom_t *doomcom; extern doomcom_t *doomcom;
/** \brief return packet in doomcom struct /** \brief return packet in doomcom struct
......
...@@ -1105,7 +1105,7 @@ static boolean UDP_Socket(void) ...@@ -1105,7 +1105,7 @@ static boolean UDP_Socket(void)
broadcastaddresses = s; broadcastaddresses = s;
doomcom->extratics = 1; // internet is very high ping extratics = 1; // internet is very high ping
return true; return true;
} }
...@@ -1393,18 +1393,18 @@ boolean I_InitTcpNetwork(void) ...@@ -1393,18 +1393,18 @@ boolean I_InitTcpNetwork(void)
// in-game. // in-game.
// Since Boris has implemented join in-game, there is no actual need for specifying a // Since Boris has implemented join in-game, there is no actual need for specifying a
// particular number here. // particular number here.
// FIXME: for dedicated server, numnodes needs to be set to 0 upon start // FIXME: for dedicated server, numnetnodes needs to be set to 0 upon start
if (dedicated) if (dedicated)
doomcom->numnodes = 0; numnetnodes = 0;
/* else if (M_IsNextParm()) /* else if (M_IsNextParm())
doomcom->numnodes = (INT16)atoi(M_GetNextParm());*/ numnetnodes = (INT16)atoi(M_GetNextParm());*/
else else
doomcom->numnodes = 1; numnetnodes = 1;
if (doomcom->numnodes < 0) if (numnetnodes < 0)
doomcom->numnodes = 0; numnetnodes = 0;
if (doomcom->numnodes > MAXNETNODES) if (numnetnodes > MAXNETNODES)
doomcom->numnodes = MAXNETNODES; numnetnodes = MAXNETNODES;
// server // server
servernode = 0; servernode = 0;
......
...@@ -269,10 +269,10 @@ void PT_TextCmd(SINT8 node, INT32 netconsole) ...@@ -269,10 +269,10 @@ void PT_TextCmd(SINT8 node, INT32 netconsole)
} }
// check if tic that we are making isn't too large else we cannot send it :( // check if tic that we are making isn't too large else we cannot send it :(
// doomcom->numslots+1 "+1" since doomcom->numslots can change within this time and sent time // numslots+1 "+1" since numslots can change within this time and sent time
j = software_MAXPACKETLENGTH j = software_MAXPACKETLENGTH
- (netbuffer->u.textcmd[0]+2+BASESERVERTICSSIZE - (netbuffer->u.textcmd[0]+2+BASESERVERTICSSIZE
+ (doomcom->numslots+1)*sizeof(ticcmd_t)); + (numslots+1)*sizeof(ticcmd_t));
// search a tic that have enougth space in the ticcmd // search a tic that have enougth space in the ticcmd
while ((textcmd = D_GetExistingTextcmd(tic, netconsole)), while ((textcmd = D_GetExistingTextcmd(tic, netconsole)),
......
...@@ -245,7 +245,7 @@ static boolean SV_SendServerConfig(INT32 node) ...@@ -245,7 +245,7 @@ static boolean SV_SendServerConfig(INT32 node)
netbuffer->packettype = PT_SERVERCFG; netbuffer->packettype = PT_SERVERCFG;
netbuffer->u.servercfg.serverplayer = (UINT8)serverplayer; netbuffer->u.servercfg.serverplayer = (UINT8)serverplayer;
netbuffer->u.servercfg.totalslotnum = (UINT8)(doomcom->numslots); netbuffer->u.servercfg.totalslotnum = (UINT8)numslots;
netbuffer->u.servercfg.gametic = (tic_t)LONG(gametic); netbuffer->u.servercfg.gametic = (tic_t)LONG(gametic);
netbuffer->u.servercfg.clientnode = (UINT8)node; netbuffer->u.servercfg.clientnode = (UINT8)node;
netbuffer->u.servercfg.gamestate = (UINT8)gamestate; netbuffer->u.servercfg.gamestate = (UINT8)gamestate;
......
...@@ -244,7 +244,7 @@ void PT_ServerTics(SINT8 node, INT32 netconsole) ...@@ -244,7 +244,7 @@ void PT_ServerTics(SINT8 node, INT32 netconsole)
if (realstart <= neededtic && realend > neededtic) if (realstart <= neededtic && realend > neededtic)
{ {
UINT8 *pak = (UINT8 *)&packet->cmds; UINT8 *pak = (UINT8 *)&packet->cmds;
UINT8 *txtpak = (UINT8 *)&packet->cmds[packet->numslots * packet->numtics]; UINT8 *txtpak = (UINT8 *)&packet->cmds[numslots * packet->numtics];
for (tic_t i = realstart; i < realend; i++) for (tic_t i = realstart; i < realend; i++)
{ {
...@@ -253,7 +253,7 @@ void PT_ServerTics(SINT8 node, INT32 netconsole) ...@@ -253,7 +253,7 @@ void PT_ServerTics(SINT8 node, INT32 netconsole)
// copy the tics // copy the tics
pak = G_ScpyTiccmd(netcmds[i%BACKUPTICS], pak, pak = G_ScpyTiccmd(netcmds[i%BACKUPTICS], pak,
packet->numslots*sizeof (ticcmd_t)); numslots*sizeof (ticcmd_t));
CL_CopyNetCommandsFromServerPacket(i, &txtpak); CL_CopyNetCommandsFromServerPacket(i, &txtpak);
} }
...@@ -320,7 +320,7 @@ static tic_t SV_CalculateNumTicsForPacket(SINT8 nodenum, tic_t firsttic, tic_t l ...@@ -320,7 +320,7 @@ static tic_t SV_CalculateNumTicsForPacket(SINT8 nodenum, tic_t firsttic, tic_t l
for (tic_t tic = firsttic; tic < lasttic; tic++) for (tic_t tic = firsttic; tic < lasttic; tic++)
{ {
size += sizeof (ticcmd_t) * doomcom->numslots; size += sizeof (ticcmd_t) * numslots;
size += TotalTextCmdPerTic(tic); size += TotalTextCmdPerTic(tic);
if (size > software_MAXPACKETLENGTH) if (size > software_MAXPACKETLENGTH)
...@@ -337,7 +337,7 @@ static tic_t SV_CalculateNumTicsForPacket(SINT8 nodenum, tic_t firsttic, tic_t l ...@@ -337,7 +337,7 @@ static tic_t SV_CalculateNumTicsForPacket(SINT8 nodenum, tic_t firsttic, tic_t l
if (size > MAXPACKETLENGTH) if (size > MAXPACKETLENGTH)
I_Error("Too many players: can't send %s data for %d players to node %d\n" I_Error("Too many players: can't send %s data for %d players to node %d\n"
"Well sorry nobody is perfect....\n", "Well sorry nobody is perfect....\n",
sizeu1(size), doomcom->numslots, nodenum); sizeu1(size), numslots, nodenum);
else else
{ {
lasttic++; // send it anyway! lasttic++; // send it anyway!
...@@ -394,20 +394,20 @@ void SV_SendTics(void) ...@@ -394,20 +394,20 @@ void SV_SendTics(void)
netbuffer->packettype = PT_SERVERTICS; netbuffer->packettype = PT_SERVERTICS;
netbuffer->u.serverpak.starttic = realfirsttic; netbuffer->u.serverpak.starttic = realfirsttic;
netbuffer->u.serverpak.numtics = (UINT8)(lasttictosend - realfirsttic); netbuffer->u.serverpak.numtics = (UINT8)(lasttictosend - realfirsttic);
netbuffer->u.serverpak.numslots = (UINT8)SHORT(doomcom->numslots); netbuffer->u.serverpak.numslots = (UINT8)SHORT(numslots);
// Fill and send the packet // Fill and send the packet
UINT8 *bufpos = (UINT8 *)&netbuffer->u.serverpak.cmds; UINT8 *bufpos = (UINT8 *)&netbuffer->u.serverpak.cmds;
for (tic_t i = realfirsttic; i < lasttictosend; i++) for (tic_t i = realfirsttic; i < lasttictosend; i++)
bufpos = G_DcpyTiccmd(bufpos, netcmds[i%BACKUPTICS], doomcom->numslots * sizeof (ticcmd_t)); bufpos = G_DcpyTiccmd(bufpos, netcmds[i%BACKUPTICS], numslots * sizeof (ticcmd_t));
for (tic_t i = realfirsttic; i < lasttictosend; i++) for (tic_t i = realfirsttic; i < lasttictosend; i++)
SV_WriteNetCommandsForTic(i, &bufpos); SV_WriteNetCommandsForTic(i, &bufpos);
size_t packsize = bufpos - (UINT8 *)&(netbuffer->u); size_t packsize = bufpos - (UINT8 *)&(netbuffer->u);
HSendPacket(n, false, 0, packsize); HSendPacket(n, false, 0, packsize);
// When tics are too large, only one tic is sent so don't go backwards! // When tics are too large, only one tic is sent so don't go backwards!
if (lasttictosend-doomcom->extratics > realfirsttic) if (lasttictosend-extratics > realfirsttic)
node->supposedtic = lasttictosend-doomcom->extratics; node->supposedtic = lasttictosend-extratics;
else else
node->supposedtic = lasttictosend; node->supposedtic = lasttictosend;
node->supposedtic = max(node->supposedtic, node->tic); node->supposedtic = max(node->supposedtic, node->tic);
......
...@@ -6109,7 +6109,7 @@ void A_UnidusBall(mobj_t *actor) ...@@ -6109,7 +6109,7 @@ void A_UnidusBall(mobj_t *actor)
else if (locvar1 == 2) else if (locvar1 == 2)
{ {
boolean skull = (actor->target->flags2 & MF2_SKULLFLY) == MF2_SKULLFLY; boolean skull = (actor->target->flags2 & MF2_SKULLFLY) == MF2_SKULLFLY;
if (actor->target->state == &states[actor->target->info->painstate]) if (P_IsMobjInPainState(actor->target))
{ {
P_KillMobj(actor, NULL, NULL, 0); P_KillMobj(actor, NULL, NULL, 0);
return; return;
......
...@@ -412,7 +412,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) ...@@ -412,7 +412,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{ {
if (special->type == MT_STEAM) if (special->type == MT_STEAM)
{ {
if (player && player->mo->state == &states[player->mo->info->painstate]) // can't use gas jets when player is in pain! if (player && P_IsPlayerInState(player, S_PLAY_PAIN)) // can't use gas jets when player is in pain!
return; return;
fixed_t speed = special->info->mass; // gas jets use this for the vertical thrust fixed_t speed = special->info->mass; // gas jets use this for the vertical thrust
...@@ -752,8 +752,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) ...@@ -752,8 +752,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{ {
if (!playeringame[i] || players[i].spectator) if (!playeringame[i] || players[i].spectator)
continue; continue;
P_DoPlayerExit(&players[i], true);
players[i].exiting = (14*TICRATE)/5 + 1;
} }
//S_StartSound(NULL, sfx_lvpass); //S_StartSound(NULL, sfx_lvpass);
} }
...@@ -1820,7 +1819,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) ...@@ -1820,7 +1819,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (!player->climbing) if (!player->climbing)
{ {
if (player->bot && player->bot != BOT_MPAI && toucher->state-states != S_PLAY_GASP) if (player->bot && player->bot != BOT_MPAI && !P_IsPlayerInState(player, S_PLAY_GASP))
S_StartSound(toucher, special->info->deathsound); // Force it to play a sound for bots S_StartSound(toucher, special->info->deathsound); // Force it to play a sound for bots
P_SetMobjState(toucher, S_PLAY_GASP); P_SetMobjState(toucher, S_PLAY_GASP);
P_ResetPlayer(player); P_ResetPlayer(player);
...@@ -1839,8 +1838,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) ...@@ -1839,8 +1838,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
special->z = toucher->z+toucher->height-FixedMul(8*FRACUNIT, special->scale); special->z = toucher->z+toucher->height-FixedMul(8*FRACUNIT, special->scale);
special->momz = 0; special->momz = 0;
special->flags |= MF_NOGRAVITY; special->flags |= MF_NOGRAVITY;
P_SetMobjState (special, special->info->deathstate); P_SetMobjState(special, special->info->deathstate);
S_StartSound (special, special->info->deathsound+(P_RandomKey(special->info->mass))); S_StartSound(special, special->info->deathsound+(P_RandomKey(special->info->mass)));
} }
return; return;
...@@ -3226,8 +3225,8 @@ static boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, IN ...@@ -3226,8 +3225,8 @@ static boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, IN
return false; return false;
// Ignore IT players shooting each other, unless friendlyfire is on. // Ignore IT players shooting each other, unless friendlyfire is on.
if ((player->pflags & PF_TAGIT && !((cv_friendlyfire.value || (gametyperules & GTR_FRIENDLYFIRE) || (damagetype & DMG_CANHURTSELF)) && if ((player->pflags & PF_TAGIT && source && source->player && !(((cv_friendlyfire.value || (gametyperules & GTR_FRIENDLYFIRE)) || ((damagetype & DMG_CANHURTSELF) && source->player == player)) &&
source && source->player && source->player->pflags & PF_TAGIT))) source->player->pflags & PF_TAGIT)))
{ {
if (inflictor->type == MT_LHRT && !(player->powers[pw_shield] & SH_NOSTACK)) if (inflictor->type == MT_LHRT && !(player->powers[pw_shield] & SH_NOSTACK))
{ {
...@@ -3242,7 +3241,8 @@ static boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, IN ...@@ -3242,7 +3241,8 @@ static boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, IN
// Don't allow players on the same team to hurt one another, // Don't allow players on the same team to hurt one another,
// unless cv_friendlyfire is on. // unless cv_friendlyfire is on.
if (!(cv_friendlyfire.value || (gametyperules & GTR_FRIENDLYFIRE) || (damagetype & DMG_CANHURTSELF)) && (player->pflags & PF_TAGIT) == (source->player->pflags & PF_TAGIT)) if (source && source->player && !((cv_friendlyfire.value || (gametyperules & GTR_FRIENDLYFIRE)) || ((damagetype & DMG_CANHURTSELF) && source->player == player)) &&
(player->pflags & PF_TAGIT) == (source->player->pflags & PF_TAGIT))
{ {
if (inflictor->type == MT_LHRT && !(player->powers[pw_shield] & SH_NOSTACK)) if (inflictor->type == MT_LHRT && !(player->powers[pw_shield] & SH_NOSTACK))
{ {
...@@ -3344,7 +3344,7 @@ static boolean P_PlayerHitsPlayer(mobj_t *target, mobj_t *inflictor, mobj_t *sou ...@@ -3344,7 +3344,7 @@ static boolean P_PlayerHitsPlayer(mobj_t *target, mobj_t *inflictor, mobj_t *sou
// Tag handling // Tag handling
if (G_TagGametype()) if (G_TagGametype())
return P_TagDamage(target, inflictor, source, damage, damagetype); return P_TagDamage(target, inflictor, source, damage, damagetype);
else if (damagetype & DMG_CANHURTSELF) else if ((damagetype & DMG_CANHURTSELF) && source && source->player && source->player == player)
return true; return true;
else if (G_GametypeHasTeams()) // CTF + Team Match else if (G_GametypeHasTeams()) // CTF + Team Match
{ {
...@@ -3413,18 +3413,20 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) ...@@ -3413,18 +3413,20 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
if ((gametyperules & GTR_TEAMFLAGS) && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))) if ((gametyperules & GTR_TEAMFLAGS) && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
{ {
P_PlayerFlagBurst(player, false); P_PlayerFlagBurst(player, false);
if (source && source->player) if (source && source->player && source->player != player) // Don't score points against yourself
{ {
// Award no points when players shoot each other when cv_friendlyfire is on. // Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo)) if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
P_AddPlayerScore(source->player, 25); P_AddPlayerScore(source->player, 25);
} }
} }
if (source && source->player && !player->powers[pw_super]) //don't score points against super players if (source && source->player && source->player != player && !player->powers[pw_super]) //don't score points against super players or yourself
{ {
// Award no points when players shoot each other when cv_friendlyfire is on. // Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo)) if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
{
P_AddPlayerScore(source->player, 100); P_AddPlayerScore(source->player, 100);
}
} }
// If the player was super, tell them he/she ain't so super nomore. // If the player was super, tell them he/she ain't so super nomore.
...@@ -3538,14 +3540,14 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, ...@@ -3538,14 +3540,14 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source,
if ((gametyperules & GTR_TEAMFLAGS) && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))) if ((gametyperules & GTR_TEAMFLAGS) && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
{ {
P_PlayerFlagBurst(player, false); P_PlayerFlagBurst(player, false);
if (source && source->player) if (source && source->player && source->player != player) // Don't score points against yourself
{ {
// Award no points when players shoot each other when cv_friendlyfire is on. // Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo)) if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
P_AddPlayerScore(source->player, 25); P_AddPlayerScore(source->player, 25);
} }
} }
if (source && source->player && !player->powers[pw_super]) //don't score points against super players if (source && source->player && source->player != player && !player->powers[pw_super]) //don't score points against super players or yourself
{ {
// Award no points when players shoot each other when cv_friendlyfire is on. // Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo)) if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
...@@ -3562,7 +3564,7 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN ...@@ -3562,7 +3564,7 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN
if (damagetype == DMG_SPIKE) // spikes if (damagetype == DMG_SPIKE) // spikes
S_StartSound(player->mo, sfx_spkdth); S_StartSound(player->mo, sfx_spkdth);
if (source && source->player && !player->powers[pw_super]) //don't score points against super players if (source && source->player && source->player != player && !player->powers[pw_super]) //don't score points against super players
{ {
// Award no points when players shoot each other when cv_friendlyfire is on. // Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo)) if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
...@@ -3572,7 +3574,7 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN ...@@ -3572,7 +3574,7 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN
if ((gametyperules & GTR_TEAMFLAGS) && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))) if ((gametyperules & GTR_TEAMFLAGS) && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
{ {
P_PlayerFlagBurst(player, false); P_PlayerFlagBurst(player, false);
if (source && source->player) if (source && source->player && source->player != player) // Don't score points against yourself
{ {
// Award no points when players shoot each other when cv_friendlyfire is on. // Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo)) if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
...@@ -3885,7 +3887,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da ...@@ -3885,7 +3887,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
// To reduce griefing potential, don't allow players to be killed // To reduce griefing potential, don't allow players to be killed
// by friendly fire. Spilling their rings and other items is enough. // by friendly fire. Spilling their rings and other items is enough.
else if (!force && G_GametypeHasTeams() else if (!force && G_GametypeHasTeams()
&& source && source->player && (source->player->ctfteam == player->ctfteam) && source && source->player && source->player != player && (source->player->ctfteam == player->ctfteam)
&& (cv_friendlyfire.value || (gametyperules & GTR_FRIENDLYFIRE))) && (cv_friendlyfire.value || (gametyperules & GTR_FRIENDLYFIRE)))
{ {
damage = 0; damage = 0;
......
...@@ -130,6 +130,10 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam); ...@@ -130,6 +130,10 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam);
void P_SlideCameraMove(camera_t *thiscam); void P_SlideCameraMove(camera_t *thiscam);
boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled); boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled);
pflags_t P_GetJumpFlags(player_t *player); pflags_t P_GetJumpFlags(player_t *player);
statenum_t P_GetCanonicalPlayerState(player_t *player, statenum_t state);
boolean P_IsPlayerInState(player_t *player, statenum_t state);
boolean P_IsPlayerInSuperTransformationState(player_t *player);
boolean P_IsPlayerInNightsTransformationState(player_t *player);
boolean P_PlayerInPain(player_t *player); boolean P_PlayerInPain(player_t *player);
void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor); void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor);
void P_ResetPlayer(player_t *player); void P_ResetPlayer(player_t *player);
...@@ -553,5 +557,6 @@ void P_DoSuperDetransformation(player_t *player); ...@@ -553,5 +557,6 @@ void P_DoSuperDetransformation(player_t *player);
void P_ExplodeMissile(mobj_t *mo); void P_ExplodeMissile(mobj_t *mo);
void P_CheckGravity(mobj_t *mo, boolean affect); void P_CheckGravity(mobj_t *mo, boolean affect);
void P_SetPitchRollFromSlope(mobj_t *mo, pslope_t *slope); void P_SetPitchRollFromSlope(mobj_t *mo, pslope_t *slope);
boolean P_IsMobjInPainState(mobj_t *mobj);
#endif // __P_LOCAL__ #endif // __P_LOCAL__
...@@ -508,7 +508,7 @@ static void P_DoFan(mobj_t *fan, mobj_t *object) ...@@ -508,7 +508,7 @@ static void P_DoFan(mobj_t *fan, mobj_t *object)
fixed_t speed = fan->info->mass; // fans use this for the vertical thrust fixed_t speed = fan->info->mass; // fans use this for the vertical thrust
SINT8 flipval = P_MobjFlip(fan); // virtually everything here centers around the thruster's gravity, not the object's! SINT8 flipval = P_MobjFlip(fan); // virtually everything here centers around the thruster's gravity, not the object's!
if (p && object->state == &states[object->info->painstate]) // can't use fans when player is in pain! if (p && P_IsPlayerInState(p, S_PLAY_PAIN)) // can't use fans when player is in pain!
return; return;
// is object's top below thruster's position? if not, calculate distance between their bottoms // is object's top below thruster's position? if not, calculate distance between their bottoms
...@@ -3033,7 +3033,7 @@ static boolean P_ThingHeightClip(mobj_t *thing) ...@@ -3033,7 +3033,7 @@ static boolean P_ThingHeightClip(mobj_t *thing)
if (tmfloorz > oldfloorz+thing->height) if (tmfloorz > oldfloorz+thing->height)
return true; return true;
bouncing = thing->player && thing->state-states == S_PLAY_BOUNCE_LANDING && P_IsObjectOnGround(thing); bouncing = thing->player && P_IsPlayerInState(thing->player, S_PLAY_BOUNCE_LANDING) && P_IsObjectOnGround(thing);
if ((onfloor || bouncing) && !(thing->flags & MF_NOGRAVITY) && floormoved) if ((onfloor || bouncing) && !(thing->flags & MF_NOGRAVITY) && floormoved)
{ {
......
...@@ -1056,7 +1056,7 @@ boolean P_BlockThingsIterator(INT32 x, INT32 y, boolean (*func)(mobj_t *), mobj_ ...@@ -1056,7 +1056,7 @@ boolean P_BlockThingsIterator(INT32 x, INT32 y, boolean (*func)(mobj_t *), mobj_
boolean checkthing = false; boolean checkthing = false;
if (thing) if (thing)
checkthing = true; checkthing = true;
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight) if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
return true; return true;
...@@ -1434,7 +1434,7 @@ static boolean P_TraverseIntercepts(traverser_t func, fixed_t maxfrac) ...@@ -1434,7 +1434,7 @@ static boolean P_TraverseIntercepts(traverser_t func, fixed_t maxfrac)
if (dist > maxfrac) if (dist > maxfrac)
return true; // Checked everything in range. return true; // Checked everything in range.
if (!func(in)) if (!func(in))
return false; // Don't bother going farther. return false; // Don't bother going farther.
...@@ -1462,7 +1462,7 @@ boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2, ...@@ -1462,7 +1462,7 @@ boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2,
validcount++; validcount++;
intercept_p = intercepts; intercept_p = intercepts;
if (((px1 - bmaporgx) & (MAPBLOCKSIZE-1)) == 0) if (((px1 - bmaporgx) & (MAPBLOCKSIZE-1)) == 0)
px1 += FRACUNIT; // Don't side exactly on a line. px1 += FRACUNIT; // Don't side exactly on a line.
...@@ -1475,7 +1475,7 @@ boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2, ...@@ -1475,7 +1475,7 @@ boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2,
trace.dy = py2 - py1; trace.dy = py2 - py1;
xt1 = px1>>MAPBLOCKSHIFT; xt1 = px1>>MAPBLOCKSHIFT;
yt1 = py2>>MAPBLOCKSHIFT; yt1 = py1>>MAPBLOCKSHIFT;
px1 = (unsigned)(px1 - bmaporgx); px1 = (unsigned)(px1 - bmaporgx);
py1 = (unsigned)(py1 - bmaporgy); py1 = (unsigned)(py1 - bmaporgy);
...@@ -1624,6 +1624,7 @@ boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2, ...@@ -1624,6 +1624,7 @@ boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2,
break; break;
} }
} }
// Go through the sorted list // Go through the sorted list
return P_TraverseIntercepts(trav, FRACUNIT); return P_TraverseIntercepts(trav, FRACUNIT);
} }
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "p_slopes.h" #include "p_slopes.h"
#include "f_finale.h" #include "f_finale.h"
#include "m_cond.h" #include "m_cond.h"
#include "simple_hashmap.h"
#include "netcode/net_command.h" #include "netcode/net_command.h"
static CV_PossibleValue_t CV_BobSpeed[] = {{0, "MIN"}, {4*FRACUNIT, "MAX"}, {0, NULL}}; static CV_PossibleValue_t CV_BobSpeed[] = {{0, "MIN"}, {4*FRACUNIT, "MAX"}, {0, NULL}};
...@@ -178,6 +179,61 @@ static void P_CycleMobjState(mobj_t *mobj) ...@@ -178,6 +179,61 @@ static void P_CycleMobjState(mobj_t *mobj)
} }
} }
static panim_t GetPlayerAnimationFromState(player_t *player, statenum_t state)
{
switch(P_GetCanonicalPlayerState(player, state))
{
case S_PLAY_STND:
case S_PLAY_WAIT:
case S_PLAY_NIGHTS_STAND:
return PA_IDLE;
case S_PLAY_EDGE:
return PA_EDGE;
case S_PLAY_WALK:
case S_PLAY_SKID:
case S_PLAY_FLOAT:
return PA_WALK;
case S_PLAY_RUN:
case S_PLAY_FLOAT_RUN:
return PA_RUN;
case S_PLAY_DASH:
return PA_DASH;
case S_PLAY_PAIN:
case S_PLAY_STUN:
return PA_PAIN;
case S_PLAY_ROLL:
//case S_PLAY_SPINDASH: -- everyone can ROLL thanks to zoom tubes...
case S_PLAY_NIGHTS_ATTACK:
return PA_ROLL;
case S_PLAY_JUMP:
return PA_JUMP;
case S_PLAY_SPRING:
return PA_SPRING;
case S_PLAY_FALL:
case S_PLAY_NIGHTS_FLOAT:
return PA_FALL;
case S_PLAY_FLY:
case S_PLAY_FLY_TIRED:
case S_PLAY_SWIM:
case S_PLAY_GLIDE:
case S_PLAY_BOUNCE:
case S_PLAY_BOUNCE_LANDING:
case S_PLAY_TWINSPIN:
return PA_ABILITY;
case S_PLAY_SPINDASH: // ...but the act of SPINDASHING is charability2 specific.
case S_PLAY_FIRE:
case S_PLAY_FIRE_FINISH:
case S_PLAY_MELEE:
case S_PLAY_MELEE_FINISH:
case S_PLAY_MELEE_LANDING:
return PA_ABILITY2;
case S_PLAY_RIDE:
return PA_RIDE;
default:
return PA_ETC;
}
}
// //
// P_SetPlayerMobjState // P_SetPlayerMobjState
// Returns true if the mobj is still present. // Returns true if the mobj is still present.
...@@ -201,6 +257,12 @@ static boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) ...@@ -201,6 +257,12 @@ static boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
I_Error("P_SetPlayerMobjState used for non-player mobj. Use P_SetMobjState instead!\n(Mobj type: %d, State: %d)", mobj->type, state); I_Error("P_SetPlayerMobjState used for non-player mobj. Use P_SetMobjState instead!\n(Mobj type: %d, State: %d)", mobj->type, state);
#endif #endif
// If the state has been overriden for this skin, use the replacement instead
statenum_t customskinstate;
SIMPLEHASH_FIND_INT(skins[player->skin]->defaulttocustomstate, hashentry_int32_int32_t, state, S_NULL, customskinstate)
if (customskinstate)
state = customskinstate;
// Catch falling for nojumpspin // Catch falling for nojumpspin
if ((state == S_PLAY_JUMP) && (player->charflags & SF_NOJUMPSPIN) && (P_MobjFlip(mobj)*mobj->momz < 0)) if ((state == S_PLAY_JUMP) && (player->charflags & SF_NOJUMPSPIN) && (P_MobjFlip(mobj)*mobj->momz < 0))
return P_SetPlayerMobjState(mobj, S_PLAY_FALL); return P_SetPlayerMobjState(mobj, S_PLAY_FALL);
...@@ -222,88 +284,24 @@ static boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) ...@@ -222,88 +284,24 @@ static boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
{ {
if (state == S_PLAY_JUMP) if (state == S_PLAY_JUMP)
{ {
if (player->mo->state-states == S_PLAY_WALK) if (P_IsPlayerInState(player, S_PLAY_WALK))
return P_SetPlayerMobjState(mobj, S_PLAY_FLOAT); return P_SetPlayerMobjState(mobj, S_PLAY_FLOAT);
return true; return true;
} }
else if (player->mo->state-states == S_PLAY_FLOAT && state == S_PLAY_STND) else if (P_IsPlayerInState(player, S_PLAY_FLOAT) && state == S_PLAY_STND)
return true; return true;
} }
// You were in pain state after taking a hit, and you're moving out of pain state now? // You were in pain state after taking a hit, and you're moving out of pain state now?
else if (mobj->state == &states[mobj->info->painstate] && player->powers[pw_flashing] == flashingtics && state != mobj->info->painstate) else if (P_IsPlayerInState(player, S_PLAY_PAIN)
&& player->powers[pw_flashing] == flashingtics
&& P_GetCanonicalPlayerState(player, state) != S_PLAY_PAIN)
{ {
// Start flashing, since you've landed. // Start flashing, since you've landed.
player->powers[pw_flashing] = flashingtics-1; player->powers[pw_flashing] = flashingtics-1;
P_DoPityCheck(player); P_DoPityCheck(player);
} }
// Set animation state player->panim = GetPlayerAnimationFromState(player, state);
// The pflags version of this was just as convoluted.
switch(state)
{
case S_PLAY_STND:
case S_PLAY_WAIT:
case S_PLAY_NIGHTS_STAND:
player->panim = PA_IDLE;
break;
case S_PLAY_EDGE:
player->panim = PA_EDGE;
break;
case S_PLAY_WALK:
case S_PLAY_SKID:
case S_PLAY_FLOAT:
player->panim = PA_WALK;
break;
case S_PLAY_RUN:
case S_PLAY_FLOAT_RUN:
player->panim = PA_RUN;
break;
case S_PLAY_DASH:
player->panim = PA_DASH;
break;
case S_PLAY_PAIN:
case S_PLAY_STUN:
player->panim = PA_PAIN;
break;
case S_PLAY_ROLL:
//case S_PLAY_SPINDASH: -- everyone can ROLL thanks to zoom tubes...
case S_PLAY_NIGHTS_ATTACK:
player->panim = PA_ROLL;
break;
case S_PLAY_JUMP:
player->panim = PA_JUMP;
break;
case S_PLAY_SPRING:
player->panim = PA_SPRING;
break;
case S_PLAY_FALL:
case S_PLAY_NIGHTS_FLOAT:
player->panim = PA_FALL;
break;
case S_PLAY_FLY:
case S_PLAY_FLY_TIRED:
case S_PLAY_SWIM:
case S_PLAY_GLIDE:
case S_PLAY_BOUNCE:
case S_PLAY_BOUNCE_LANDING:
case S_PLAY_TWINSPIN:
player->panim = PA_ABILITY;
break;
case S_PLAY_SPINDASH: // ...but the act of SPINDASHING is charability2 specific.
case S_PLAY_FIRE:
case S_PLAY_FIRE_FINISH:
case S_PLAY_MELEE:
case S_PLAY_MELEE_FINISH:
case S_PLAY_MELEE_LANDING:
player->panim = PA_ABILITY2;
break;
case S_PLAY_RIDE:
player->panim = PA_RIDE;
break;
default:
player->panim = PA_ETC;
break;
}
if (recursion++) // if recursion detected, if (recursion++) // if recursion detected,
memset(seenstate = tempstate, 0, sizeof tempstate); // clear state table memset(seenstate = tempstate, 0, sizeof tempstate); // clear state table
...@@ -3717,7 +3715,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj) ...@@ -3717,7 +3715,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
// momentum movement // momentum movement
mobj->eflags &= ~MFE_JUSTSTEPPEDDOWN; mobj->eflags &= ~MFE_JUSTSTEPPEDDOWN;
if (mobj->state-states == S_PLAY_BOUNCE_LANDING) if (P_IsPlayerInState(mobj->player, S_PLAY_BOUNCE_LANDING))
goto animonly; // no need for checkposition - doesn't move at ALL goto animonly; // no need for checkposition - doesn't move at ALL
// Zoom tube // Zoom tube
...@@ -7013,14 +7011,6 @@ static void P_MobjScaleThink(mobj_t *mobj) ...@@ -7013,14 +7011,6 @@ static void P_MobjScaleThink(mobj_t *mobj)
mobj->z -= (mobj->height - oldheight)/2; mobj->z -= (mobj->height - oldheight)/2;
else if (correctionType == 2) else if (correctionType == 2)
mobj->z -= mobj->height - oldheight; mobj->z -= mobj->height - oldheight;
if (mobj->scale == mobj->destscale)
/// \todo Lua hook for "reached destscale"?
switch (mobj->type)
{
default:
break;
}
} }
static void P_MaceSceneryThink(mobj_t *mobj) static void P_MaceSceneryThink(mobj_t *mobj)
...@@ -10139,6 +10129,7 @@ static boolean P_FuseThink(mobj_t *mobj) ...@@ -10139,6 +10129,7 @@ static boolean P_FuseThink(mobj_t *mobj)
// //
void P_MobjThinker(mobj_t *mobj) void P_MobjThinker(mobj_t *mobj)
{ {
boolean ispushable;
I_Assert(mobj != NULL); I_Assert(mobj != NULL);
I_Assert(!P_MobjWasRemoved(mobj)); I_Assert(!P_MobjWasRemoved(mobj));
...@@ -10164,8 +10155,10 @@ void P_MobjThinker(mobj_t *mobj) ...@@ -10164,8 +10155,10 @@ void P_MobjThinker(mobj_t *mobj)
tmfloorthing = tmhitthing = NULL; tmfloorthing = tmhitthing = NULL;
ispushable = mobj->flags & MF_PUSHABLE || (mobj->info->flags & MF_PUSHABLE && mobj->fuse);
// Sector flag MSF_TRIGGERLINE_MOBJ allows ANY mobj to trigger a linedef exec // Sector flag MSF_TRIGGERLINE_MOBJ allows ANY mobj to trigger a linedef exec
P_CheckMobjTrigger(mobj, false); P_CheckMobjTrigger(mobj, ispushable);
if (mobj->scale != mobj->destscale) if (mobj->scale != mobj->destscale)
P_MobjScaleThink(mobj); // Slowly scale up/down to reach your destscale. P_MobjScaleThink(mobj); // Slowly scale up/down to reach your destscale.
...@@ -10209,7 +10202,7 @@ void P_MobjThinker(mobj_t *mobj) ...@@ -10209,7 +10202,7 @@ void P_MobjThinker(mobj_t *mobj)
// if it's pushable, or if it would be pushable other than temporary disablement, use the // if it's pushable, or if it would be pushable other than temporary disablement, use the
// separate thinker // separate thinker
if (mobj->flags & MF_PUSHABLE || (mobj->info->flags & MF_PUSHABLE && mobj->fuse)) if (ispushable)
{ {
if (!P_MobjPushableThink(mobj)) if (!P_MobjPushableThink(mobj))
return; return;
...@@ -10385,8 +10378,6 @@ void P_PushableThinker(mobj_t *mobj) ...@@ -10385,8 +10378,6 @@ void P_PushableThinker(mobj_t *mobj)
I_Assert(mobj != NULL); I_Assert(mobj != NULL);
I_Assert(!P_MobjWasRemoved(mobj)); I_Assert(!P_MobjWasRemoved(mobj));
P_CheckMobjTrigger(mobj, true);
// it has to be pushable RIGHT NOW for this part to happen // it has to be pushable RIGHT NOW for this part to happen
if (mobj->flags & MF_PUSHABLE && !(mobj->momx || mobj->momy)) if (mobj->flags & MF_PUSHABLE && !(mobj->momx || mobj->momy))
P_TryMove(mobj, mobj->x, mobj->y, true); P_TryMove(mobj, mobj->x, mobj->y, true);
...@@ -14372,3 +14363,11 @@ mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zo ...@@ -14372,3 +14363,11 @@ mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zo
return newmobj; return newmobj;
} }
boolean P_IsMobjInPainState(mobj_t *mobj)
{
if (mobj->player)
return P_IsPlayerInState(mobj->player, S_PLAY_PAIN);
else
return (mobj->state == &states[mobj->info->painstate]);
}
...@@ -302,6 +302,18 @@ typedef enum ...@@ -302,6 +302,18 @@ typedef enum
DRONE = 0x80, DRONE = 0x80,
} player_saveflags; } player_saveflags;
static inline UINT32 SavePlayer(const player_t *player)
{
if (player) return (UINT32)(player - players);
return 0xFFFFFFFF;
}
static inline player_t *LoadPlayer(UINT32 player)
{
if (player >= MAXPLAYERS) return NULL;
return &players[player];
}
static inline void P_ArchivePlayer(save_t *save_p) static inline void P_ArchivePlayer(save_t *save_p)
{ {
const player_t *player = &players[consoleplayer]; const player_t *player = &players[consoleplayer];
...@@ -441,6 +453,7 @@ static void P_NetArchivePlayers(save_t *save_p) ...@@ -441,6 +453,7 @@ static void P_NetArchivePlayers(save_t *save_p)
// Bots // // Bots //
////////// //////////
P_WriteUINT8(save_p, players[i].bot); P_WriteUINT8(save_p, players[i].bot);
P_WriteUINT32(save_p, SavePlayer(players[i].botleader));
P_WriteUINT8(save_p, players[i].botmem.lastForward); P_WriteUINT8(save_p, players[i].botmem.lastForward);
P_WriteUINT8(save_p, players[i].botmem.lastBlocked); P_WriteUINT8(save_p, players[i].botmem.lastBlocked);
P_WriteUINT8(save_p, players[i].botmem.catchup_tics); P_WriteUINT8(save_p, players[i].botmem.catchup_tics);
...@@ -672,6 +685,7 @@ static void P_NetUnArchivePlayers(save_t *save_p) ...@@ -672,6 +685,7 @@ static void P_NetUnArchivePlayers(save_t *save_p)
// Bots // // Bots //
////////// //////////
players[i].bot = P_ReadUINT8(save_p); players[i].bot = P_ReadUINT8(save_p);
players[i].botleader = LoadPlayer(P_ReadUINT32(save_p));
players[i].botmem.lastForward = P_ReadUINT8(save_p); players[i].botmem.lastForward = P_ReadUINT8(save_p);
players[i].botmem.lastBlocked = P_ReadUINT8(save_p); players[i].botmem.lastBlocked = P_ReadUINT8(save_p);
...@@ -2106,12 +2120,6 @@ static UINT32 SaveLine(const line_t *line) ...@@ -2106,12 +2120,6 @@ static UINT32 SaveLine(const line_t *line)
return 0xFFFFFFFF; return 0xFFFFFFFF;
} }
static inline UINT32 SavePlayer(const player_t *player)
{
if (player) return (UINT32)(player - players);
return 0xFFFFFFFF;
}
static UINT32 SaveSlope(const pslope_t *slope) static UINT32 SaveSlope(const pslope_t *slope)
{ {
if (slope) return (UINT32)(slope->id); if (slope) return (UINT32)(slope->id);
...@@ -3237,12 +3245,6 @@ static line_t *LoadLine(UINT32 line) ...@@ -3237,12 +3245,6 @@ static line_t *LoadLine(UINT32 line)
return &lines[line]; return &lines[line];
} }
static inline player_t *LoadPlayer(UINT32 player)
{
if (player >= MAXPLAYERS) return NULL;
return &players[player];
}
static inline pslope_t *LoadSlope(UINT32 slopeid) static inline pslope_t *LoadSlope(UINT32 slopeid)
{ {
pslope_t *p = slopelist; pslope_t *p = slopelist;
...@@ -4825,6 +4827,8 @@ static void P_NetArchiveMisc(save_t *save_p, boolean resending) ...@@ -4825,6 +4827,8 @@ static void P_NetArchiveMisc(save_t *save_p, boolean resending)
P_WriteUINT16(save_p, skincolor_redring); P_WriteUINT16(save_p, skincolor_redring);
P_WriteUINT16(save_p, skincolor_bluering); P_WriteUINT16(save_p, skincolor_bluering);
P_WriteINT32(save_p, nummaprings);
P_WriteINT32(save_p, modulothing); P_WriteINT32(save_p, modulothing);
P_WriteINT16(save_p, autobalance); P_WriteINT16(save_p, autobalance);
...@@ -4929,6 +4933,8 @@ static inline boolean P_NetUnArchiveMisc(save_t *save_p, boolean reloading) ...@@ -4929,6 +4933,8 @@ static inline boolean P_NetUnArchiveMisc(save_t *save_p, boolean reloading)
skincolor_redring = P_ReadUINT16(save_p); skincolor_redring = P_ReadUINT16(save_p);
skincolor_bluering = P_ReadUINT16(save_p); skincolor_bluering = P_ReadUINT16(save_p);
nummaprings = P_ReadINT32(save_p);
modulothing = P_ReadINT32(save_p); modulothing = P_ReadINT32(save_p);
autobalance = P_ReadINT16(save_p); autobalance = P_ReadINT16(save_p);
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
/// \file p_setup.c /// \file p_setup.c
/// \brief Do all the WAD I/O, get map description, set up initial state and misc. LUTs /// \brief Do all the WAD I/O, get map description, set up initial state and misc. LUTs
#include <errno.h>
#include "doomdef.h" #include "doomdef.h"
#include "d_main.h" #include "d_main.h"
#include "byteptr.h" #include "byteptr.h"
...@@ -1077,6 +1080,7 @@ static void P_LoadSectors(UINT8 *data) ...@@ -1077,6 +1080,7 @@ static void P_LoadSectors(UINT8 *data)
ss->triggerer = TO_PLAYER; ss->triggerer = TO_PLAYER;
ss->friction = ORIG_FRICTION; ss->friction = ORIG_FRICTION;
ss->customargs = NULL;
P_InitializeSector(ss); P_InitializeSector(ss);
} }
...@@ -1199,6 +1203,8 @@ static void P_LoadLinedefs(UINT8 *data) ...@@ -1199,6 +1203,8 @@ static void P_LoadLinedefs(UINT8 *data)
if (ld->sidenum[1] == 0xffff) if (ld->sidenum[1] == 0xffff)
ld->sidenum[1] = NO_SIDEDEF; ld->sidenum[1] = NO_SIDEDEF;
ld->customargs = NULL;
P_InitializeLinedef(ld); P_InitializeLinedef(ld);
} }
} }
...@@ -1370,6 +1376,8 @@ static void P_LoadSidedefs(UINT8 *data) ...@@ -1370,6 +1376,8 @@ static void P_LoadSidedefs(UINT8 *data)
sd->light = sd->light_top = sd->light_mid = sd->light_bottom = 0; sd->light = sd->light_top = sd->light_mid = sd->light_bottom = 0;
sd->lightabsolute = sd->lightabsolute_top = sd->lightabsolute_mid = sd->lightabsolute_bottom = false; sd->lightabsolute = sd->lightabsolute_top = sd->lightabsolute_mid = sd->lightabsolute_bottom = false;
sd->customargs = NULL;
P_SetSidedefSector(i, (UINT16)SHORT(msd->sector)); P_SetSidedefSector(i, (UINT16)SHORT(msd->sector));
// Special info stored in texture fields! // Special info stored in texture fields!
...@@ -1553,6 +1561,7 @@ static void P_LoadThings(UINT8 *data) ...@@ -1553,6 +1561,7 @@ static void P_LoadThings(UINT8 *data)
mt->z = mt->options >> ZSHIFT; mt->z = mt->options >> ZSHIFT;
mt->mobj = NULL; mt->mobj = NULL;
mt->customargs = NULL;
} }
} }
...@@ -1657,6 +1666,89 @@ static boolean TextmapCount(size_t size) ...@@ -1657,6 +1666,89 @@ static boolean TextmapCount(size_t size)
return true; return true;
} }
static void ParseTextmapCustomFields(const char* param, const char* val, customargs_t** headptr)
{
if (val[0] == '\0')
return;
//
// GET latest node
//
customargs_t* newnode = Z_Malloc(sizeof(customargs_t), PU_LEVEL, NULL);
if (!newnode)
return;
newnode->next = NULL;
if (*headptr == NULL) {
*headptr = newnode;
}
else {
customargs_t* curr = *headptr;
while (curr->next != NULL) {
curr = curr->next;
}
curr->next = newnode;
}
//
// Setup
//
newnode->name = Z_Malloc(strlen(param + 5) + 1, PU_LEVEL, NULL);
M_Memcpy(newnode->name, param + 5, strlen(param + 5) + 1);
if (fastcmp(val, "true"))
{
newnode->type = UDMF_TYPE_BOOLEAN;
newnode->value.vbool = true;
}
else if (fastcmp(val, "false"))
{
newnode->type = UDMF_TYPE_BOOLEAN;
newnode->value.vbool = false;
}
else
{
char* endptr;
long lval;
float fval;
// Eval integer
errno = 0;
lval = strtol(val, &endptr, 10);
if (*endptr == '\0' && endptr != val && errno == 0) {
newnode->type = UDMF_TYPE_NUMERIC;
newnode->value.vint = lval;
return;
}
// Eval float
errno = 0;
fval = strtof(val, &endptr);
if (*endptr == '\0' && endptr != val && errno == 0) {
newnode->type = UDMF_TYPE_FIXED;
newnode->value.vfloat = FLOAT_TO_FIXED(fval);
return;
}
// Just string
newnode->type = UDMF_TYPE_STRING;
newnode->value.vstring = Z_Malloc(strlen(val) + 1, PU_LEVEL, NULL);
M_Memcpy(newnode->value.vstring, val, strlen(val) + 1);
}
}
static void ParseTextmapVertexParameter(UINT32 i, const char *param, const char *val) static void ParseTextmapVertexParameter(UINT32 i, const char *param, const char *val)
{ {
if (fastcmp(param, "x")) if (fastcmp(param, "x"))
...@@ -1756,6 +1848,8 @@ static void ParseTextmapSectorParameter(UINT32 i, const char *param, const char ...@@ -1756,6 +1848,8 @@ static void ParseTextmapSectorParameter(UINT32 i, const char *param, const char
sectors[i].floorangle = FixedAngle(FLOAT_TO_FIXED(atof(val))); sectors[i].floorangle = FixedAngle(FLOAT_TO_FIXED(atof(val)));
else if (fastcmp(param, "rotationceiling")) else if (fastcmp(param, "rotationceiling"))
sectors[i].ceilingangle = FixedAngle(FLOAT_TO_FIXED(atof(val))); sectors[i].ceilingangle = FixedAngle(FLOAT_TO_FIXED(atof(val)));
else if (fastncmp(param, "user_", 5) && strlen(param) > 5)
ParseTextmapCustomFields(param, val, &sectors[i].customargs);
else if (fastcmp(param, "floorplane_a")) else if (fastcmp(param, "floorplane_a"))
{ {
textmap_planefloor.defined |= PD_A; textmap_planefloor.defined |= PD_A;
...@@ -1996,6 +2090,8 @@ static void ParseTextmapSidedefParameter(UINT32 i, const char *param, const char ...@@ -1996,6 +2090,8 @@ static void ParseTextmapSidedefParameter(UINT32 i, const char *param, const char
sides[i].lightabsolute_mid = true; sides[i].lightabsolute_mid = true;
else if (fastcmp(param, "lightabsolute_bottom") && fastcmp("true", val)) else if (fastcmp(param, "lightabsolute_bottom") && fastcmp("true", val))
sides[i].lightabsolute_bottom = true; sides[i].lightabsolute_bottom = true;
else if (fastncmp(param, "user_", 5) && strlen(param) > 5)
ParseTextmapCustomFields(param, val, &sides[i].customargs);
} }
static void ParseTextmapLinedefParameter(UINT32 i, const char *param, const char *val) static void ParseTextmapLinedefParameter(UINT32 i, const char *param, const char *val)
...@@ -2090,6 +2186,9 @@ static void ParseTextmapLinedefParameter(UINT32 i, const char *param, const char ...@@ -2090,6 +2186,9 @@ static void ParseTextmapLinedefParameter(UINT32 i, const char *param, const char
lines[i].flags |= ML_BOUNCY; lines[i].flags |= ML_BOUNCY;
else if (fastcmp(param, "transfer") && fastcmp("true", val)) else if (fastcmp(param, "transfer") && fastcmp("true", val))
lines[i].flags |= ML_TFERLINE; lines[i].flags |= ML_TFERLINE;
else if (fastncmp(param, "user_", 5) && strlen(param) > 5)
ParseTextmapCustomFields(param, val, &lines[i].customargs);
} }
static void ParseTextmapThingParameter(UINT32 i, const char *param, const char *val) static void ParseTextmapThingParameter(UINT32 i, const char *param, const char *val)
...@@ -2149,6 +2248,8 @@ static void ParseTextmapThingParameter(UINT32 i, const char *param, const char * ...@@ -2149,6 +2248,8 @@ static void ParseTextmapThingParameter(UINT32 i, const char *param, const char *
return; return;
mapthings[i].args[argnum] = atol(val); mapthings[i].args[argnum] = atol(val);
} }
else if (fastncmp(param, "user_", 5) && strlen(param) > 5)
ParseTextmapCustomFields(param, val, &mapthings[i].customargs);
} }
/** From a given position table, run a specified parser function through a {}-encapsuled text. /** From a given position table, run a specified parser function through a {}-encapsuled text.
...@@ -3053,6 +3154,7 @@ static void P_LoadTextmap(void) ...@@ -3053,6 +3154,7 @@ static void P_LoadTextmap(void)
sc->triggerer = TO_PLAYER; sc->triggerer = TO_PLAYER;
sc->friction = ORIG_FRICTION; sc->friction = ORIG_FRICTION;
sc->customargs = NULL;
textmap_colormap.used = false; textmap_colormap.used = false;
textmap_colormap.lightcolor = 0; textmap_colormap.lightcolor = 0;
...@@ -3114,6 +3216,7 @@ static void P_LoadTextmap(void) ...@@ -3114,6 +3216,7 @@ static void P_LoadTextmap(void)
ld->executordelay = 0; ld->executordelay = 0;
ld->sidenum[0] = NO_SIDEDEF; ld->sidenum[0] = NO_SIDEDEF;
ld->sidenum[1] = NO_SIDEDEF; ld->sidenum[1] = NO_SIDEDEF;
ld->customargs = NULL;
TextmapParse(linedefBlocks.pos[i], i, ParseTextmapLinedefParameter); TextmapParse(linedefBlocks.pos[i], i, ParseTextmapLinedefParameter);
...@@ -3143,6 +3246,7 @@ static void P_LoadTextmap(void) ...@@ -3143,6 +3246,7 @@ static void P_LoadTextmap(void)
sd->repeatcnt = 0; sd->repeatcnt = 0;
sd->light = sd->light_top = sd->light_mid = sd->light_bottom = 0; sd->light = sd->light_top = sd->light_mid = sd->light_bottom = 0;
sd->lightabsolute = sd->lightabsolute_top = sd->lightabsolute_mid = sd->lightabsolute_bottom = false; sd->lightabsolute = sd->lightabsolute_top = sd->lightabsolute_mid = sd->lightabsolute_bottom = false;
sd->customargs = NULL;
TextmapParse(sidedefBlocks.pos[i], i, ParseTextmapSidedefParameter); TextmapParse(sidedefBlocks.pos[i], i, ParseTextmapSidedefParameter);
...@@ -3167,6 +3271,7 @@ static void P_LoadTextmap(void) ...@@ -3167,6 +3271,7 @@ static void P_LoadTextmap(void)
memset(mt->args, 0, NUMMAPTHINGARGS*sizeof(*mt->args)); memset(mt->args, 0, NUMMAPTHINGARGS*sizeof(*mt->args));
memset(mt->stringargs, 0x00, NUMMAPTHINGSTRINGARGS*sizeof(*mt->stringargs)); memset(mt->stringargs, 0x00, NUMMAPTHINGSTRINGARGS*sizeof(*mt->stringargs));
mt->mobj = NULL; mt->mobj = NULL;
mt->customargs = NULL;
TextmapParse(mapthingBlocks.pos[i], i, ParseTextmapThingParameter); TextmapParse(mapthingBlocks.pos[i], i, ParseTextmapThingParameter);
} }
......
...@@ -4677,7 +4677,7 @@ static void P_ProcessZoomTube(player_t *player, mtag_t sectag, boolean end) ...@@ -4677,7 +4677,7 @@ static void P_ProcessZoomTube(player_t *player, mtag_t sectag, boolean end)
player->pflags &= ~(PF_JUMPED|PF_NOJUMPDAMAGE|PF_GLIDING|PF_BOUNCING|PF_SLIDING|PF_CANCARRY); player->pflags &= ~(PF_JUMPED|PF_NOJUMPDAMAGE|PF_GLIDING|PF_BOUNCING|PF_SLIDING|PF_CANCARRY);
player->climbing = 0; player->climbing = 0;
if (player->mo->state-states != S_PLAY_ROLL) if (!P_IsPlayerInState(player, S_PLAY_ROLL))
{ {
P_SetMobjState(player->mo, S_PLAY_ROLL); P_SetMobjState(player->mo, S_PLAY_ROLL);
S_StartSound(player->mo, sfx_spin); S_StartSound(player->mo, sfx_spin);
...@@ -4758,7 +4758,7 @@ static void P_ProcessRopeHang(player_t *player, mtag_t sectag) ...@@ -4758,7 +4758,7 @@ static void P_ProcessRopeHang(player_t *player, mtag_t sectag)
if (player->cmd.buttons & BT_SPIN) if (player->cmd.buttons & BT_SPIN)
return; return;
if (!(player->pflags & PF_SLIDING) && player->mo->state == &states[player->mo->info->painstate]) if (!(player->pflags & PF_SLIDING) && P_IsPlayerInState(player, S_PLAY_PAIN))
return; return;
if (player->exiting) if (player->exiting)
...@@ -8805,7 +8805,7 @@ void T_Pusher(pusher_t *p) ...@@ -8805,7 +8805,7 @@ void T_Pusher(pusher_t *p)
if (thing->player && thing->player->powers[pw_carry] == CR_ROPEHANG) if (thing->player && thing->player->powers[pw_carry] == CR_ROPEHANG)
continue; continue;
if (thing->player && (thing->state == &states[thing->info->painstate]) && (thing->player->powers[pw_flashing] > (flashingtics/4)*3 && thing->player->powers[pw_flashing] <= flashingtics)) if (thing->player && P_IsPlayerInState(thing->player, S_PLAY_PAIN) && (thing->player->powers[pw_flashing] > (flashingtics/4)*3 && thing->player->powers[pw_flashing] <= flashingtics))
continue; continue;
inFOF = touching = moved = false; inFOF = touching = moved = false;
......
...@@ -727,6 +727,7 @@ void P_Ticker(boolean run) ...@@ -727,6 +727,7 @@ void P_Ticker(boolean run)
{ {
P_MapStart(); P_MapStart();
R_UpdateMobjInterpolators(); R_UpdateMobjInterpolators();
R_UpdateLevelInterpolators();
OP_ObjectplaceMovement(&players[0]); OP_ObjectplaceMovement(&players[0]);
P_MoveChaseCamera(&players[0], &camera, false); P_MoveChaseCamera(&players[0], &camera, false);
R_UpdateViewInterpolation(); R_UpdateViewInterpolation();
......
This diff is collapsed.
...@@ -556,6 +556,8 @@ typedef struct sector_s ...@@ -556,6 +556,8 @@ typedef struct sector_s
// portals // portals
UINT32 portal_floor; UINT32 portal_floor;
UINT32 portal_ceiling; UINT32 portal_ceiling;
struct customargs_s* customargs;
} sector_t; } sector_t;
// //
...@@ -618,6 +620,7 @@ typedef struct line_s ...@@ -618,6 +620,7 @@ typedef struct line_s
UINT32 secportal; // transferred sector portal UINT32 secportal; // transferred sector portal
struct pslope_s *midtexslope; struct pslope_s *midtexslope;
struct customargs_s *customargs;
} line_t; } line_t;
typedef struct typedef struct
...@@ -654,6 +657,7 @@ typedef struct ...@@ -654,6 +657,7 @@ typedef struct
INT16 repeatcnt; // # of times to repeat midtexture INT16 repeatcnt; // # of times to repeat midtexture
extracolormap_t *colormap_data; // storage for colormaps; not applied to sectors. extracolormap_t *colormap_data; // storage for colormaps; not applied to sectors.
struct customargs_s* customargs;
} side_t; } side_t;
// //
......
...@@ -31,14 +31,12 @@ patch_t *Patch_Create(INT16 width, INT16 height) ...@@ -31,14 +31,12 @@ patch_t *Patch_Create(INT16 width, INT16 height)
return patch; return patch;
} }
patch_t *Patch_CreateFromDoomPatch(softwarepatch_t *source) patch_t *Patch_CreateFromDoomPatch(softwarepatch_t *source, size_t insize)
{ {
patch_t *patch = Patch_Create(0, 0); if (!Picture_CheckIfDoomPatch(source, insize))
if (!source) return NULL;
return patch;
patch->width = SHORT(source->width); patch_t *patch = Patch_Create(SHORT(source->width), SHORT(source->height));
patch->height = SHORT(source->height);
patch->leftoffset = SHORT(source->leftoffset); patch->leftoffset = SHORT(source->leftoffset);
patch->topoffset = SHORT(source->topoffset); patch->topoffset = SHORT(source->topoffset);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
// Patch functions // Patch functions
patch_t *Patch_Create(INT16 width, INT16 height); patch_t *Patch_Create(INT16 width, INT16 height);
patch_t *Patch_CreateFromDoomPatch(softwarepatch_t *source); patch_t *Patch_CreateFromDoomPatch(softwarepatch_t *source, size_t insize);
void Patch_CalcDataSizes(softwarepatch_t *source, size_t *total_pixels, size_t *total_posts); void Patch_CalcDataSizes(softwarepatch_t *source, size_t *total_pixels, size_t *total_posts);
void Patch_MakeColumns(softwarepatch_t *source, size_t num_columns, INT16 width, UINT8 *pixels, column_t *columns, post_t *posts, boolean flip); void Patch_MakeColumns(softwarepatch_t *source, size_t num_columns, INT16 width, UINT8 *pixels, column_t *columns, post_t *posts, boolean flip);
void Patch_Free(patch_t *patch); void Patch_Free(patch_t *patch);
......
...@@ -54,12 +54,26 @@ INT32 R_GetRollAngle(angle_t rollangle) ...@@ -54,12 +54,26 @@ INT32 R_GetRollAngle(angle_t rollangle)
patch_t *Patch_GetRotated(patch_t *patch, INT32 angle, boolean flip) patch_t *Patch_GetRotated(patch_t *patch, INT32 angle, boolean flip)
{ {
rotsprite_t *rotsprite = patch->rotated; rotsprite_t *rotsprite = patch->rotated;
if (rotsprite == NULL || angle < 1 || angle >= ROTANGLES) if (angle < 1 || angle >= ROTANGLES)
return NULL; return NULL;
if (rotsprite == NULL)
{
rotsprite = RotatedPatch_Create(ROTANGLES);
patch->rotated = rotsprite;
}
if (flip) if (flip)
angle += rotsprite->angles; angle += rotsprite->angles;
if (rotsprite->patches[angle] == NULL)
{
INT32 xpivot = 0, ypivot = 0;
xpivot = patch->leftoffset;
ypivot = patch->topoffset;
RotatedPatch_DoRotation(rotsprite, patch, angle, xpivot, ypivot, flip);
}
return rotsprite->patches[angle]; return rotsprite->patches[angle];
} }
......