From 04a38a683bc436ad2e00ebebcc223b1acc059a28 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 31 Oct 2016 20:15:11 +0000 Subject: [PATCH] Okay, this is a biggun. Pay attention, everyone. Moved the handling of P_PlayerInSpecialSector to P_PlayerAfterThink from P_PlayerThink. * This allows the player to get hurt on sloped lava surfaces that are moving downwards. * Also prevents the player from standing on death pits for 1 tic. * Prevents the player moving 1 extra tic's worth of movement of pain when hit by sector. * Thankfully, no consequences re conveyors. * Like, the only consequences I've found have been positive. However, this DOES need to be thoroughly investigated before it can be allowed anywhere near Next itself. --- src/doomdef.h | 4 ++++ src/p_user.c | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/doomdef.h b/src/doomdef.h index fb8ab1ca2..7d883849d 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -495,4 +495,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// \note You should leave this enabled unless you're working with a future SRB2 version. #define MUSICSLOT_COMPATIBILITY +/// Handle touching sector specials in P_PlayerAfterThink instead of P_PlayerThink. +/// \note Required for proper collision with moving sloped surfaces that have sector specials on them. +#define SECTORSPECIALSAFTERTHINK + #endif // __DOOMDEF__ diff --git a/src/p_user.c b/src/p_user.c index 801eb5951..921f1240d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8779,6 +8779,7 @@ void P_PlayerThink(player_t *player) // check water content, set stuff in mobj P_MobjCheckWater(player->mo); +#ifndef SECTORSPECIALSAFTERTHINK #ifdef POLYOBJECTS if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo)) #endif @@ -8787,6 +8788,7 @@ void P_PlayerThink(player_t *player) if (!player->spectator) P_PlayerInSpecialSector(player); +#endif if (player->playerstate == PST_DEAD) { @@ -9148,6 +9150,17 @@ void P_PlayerAfterThink(player_t *player) cmd = &player->cmd; +#ifdef SECTORSPECIALSAFTERTHINK +#ifdef POLYOBJECTS + if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo)) +#endif + player->onconveyor = 0; + // check special sectors : damage & secrets + + if (!player->spectator) + P_PlayerInSpecialSector(player); +#endif + if (splitscreen && player == &players[secondarydisplayplayer]) thiscam = &camera2; else if (player == &players[displayplayer])