From 94f0eedb6082e53d071f89ef2a2e944c03c8a0b8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 24 Dec 2018 17:59:12 +0000 Subject: [PATCH 1/4] Fix bot players using the respawning code meant only for real players to use --- src/p_user.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index a27e571ed..e4cb01f63 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7630,6 +7630,9 @@ static void P_DeathThink(player_t *player) if (player->deadtimer < INT32_MAX) player->deadtimer++; + if (player->bot) // don't allow bots to do any of the below, B_CheckRespawn does all they need for respawning already + goto notrealplayer; + // continue logic if (!(netgame || multiplayer) && player->lives <= 0) { @@ -7749,6 +7752,8 @@ static void P_DeathThink(player_t *player) } } +notrealplayer: + if (!player->mo) return; From e96a345fcedd5dca3e6a6b247d9a9fc60ee0434e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 24 Dec 2018 19:29:54 +0000 Subject: [PATCH 2/4] Fix disablespeedajdust in SOCs being set like an integer value instead of a boolean --- src/dehacked.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index cd9156766..837ea810c 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -3044,7 +3044,7 @@ static void readmaincfg(MYFILE *f) else if (fastcmp(word, "DISABLESPEEDADJUST")) { DEH_WriteUndoline(word, va("%d", disableSpeedAdjust), UNDO_NONE); - disableSpeedAdjust = (UINT8)get_number(word2); + disableSpeedAdjust = (value || word2[0] == 'T' || word2[0] == 'Y'); } else if (fastcmp(word, "NUMDEMOS")) { From 06e2da214e8f5781061736cd7523dfccfb1782d9 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 24 Dec 2018 19:37:52 +0000 Subject: [PATCH 3/4] remove these unnecessary typedefs for assignments to variables that are actually already boolean to begin with, since the rhs resolves to a boolean anyway --- src/dehacked.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 837ea810c..60379df07 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2952,7 +2952,7 @@ static void readmaincfg(MYFILE *f) else if (fastcmp(word, "USENIGHTSSS")) { DEH_WriteUndoline(word, va("%d", useNightsSS), UNDO_NONE); - useNightsSS = (UINT8)(value || word2[0] == 'T' || word2[0] == 'Y'); + useNightsSS = (value || word2[0] == 'T' || word2[0] == 'Y'); } else if (fastcmp(word, "REDTEAM")) { @@ -3026,7 +3026,7 @@ static void readmaincfg(MYFILE *f) else if (fastcmp(word, "LOOPTITLE")) { DEH_WriteUndoline(word, va("%d", looptitle), UNDO_NONE); - looptitle = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y'); + looptitle = (value || word2[0] == 'T' || word2[0] == 'Y'); } else if (fastcmp(word, "TITLESCROLLSPEED")) { From 55d300c4e2448f69a29e487041ec951ccd063abb Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 23 Dec 2018 23:38:07 -0500 Subject: [PATCH 4/4] Fix move by waypoints not checking for sector changes It seemed weird at first, but the polyobject sector (backsector) itself DOESN'T need checked (although I still am doing it for safety). Rather, the in-level sector just needs checked. If someone manually modifies the polyobject sector though, then this bug can still occur... but this fixes it for the most common use-case where this can happen. I'll try to tackle the rarer cases in my next commit. --- src/p_polyobj.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/p_polyobj.c b/src/p_polyobj.c index 8d0f4dab6..82c57c85b 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -1859,6 +1859,9 @@ void T_PolyObjWaypoint(polywaypoint_t *th) diffz = po->lines[0]->backsector->floorheight - (target->z - amtz); po->lines[0]->backsector->floorheight = target->z - amtz; po->lines[0]->backsector->ceilingheight = target->z + amtz; + // Sal: Remember to check your sectors! + P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage)); + P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage)); // Apply action to mirroring polyobjects as well start = 0; while ((po = Polyobj_GetChild(oldpo, &start))) @@ -1870,6 +1873,9 @@ void T_PolyObjWaypoint(polywaypoint_t *th) // TODO: use T_MovePlane po->lines[0]->backsector->floorheight += diffz; // move up/down by same amount as the parent did po->lines[0]->backsector->ceilingheight += diffz; + // Sal: Remember to check your sectors! + P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage)); + P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage)); } po = oldpo; @@ -2030,6 +2036,9 @@ void T_PolyObjWaypoint(polywaypoint_t *th) // TODO: use T_MovePlane po->lines[0]->backsector->floorheight += momz; po->lines[0]->backsector->ceilingheight += momz; + // Sal: Remember to check your sectors! + P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage)); // frontsector is NEEDED for crushing + P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage)); // backsector may not be necessary, but just in case // Apply action to mirroring polyobjects as well start = 0; @@ -2042,6 +2051,9 @@ void T_PolyObjWaypoint(polywaypoint_t *th) // TODO: use T_MovePlane po->lines[0]->backsector->floorheight += momz; po->lines[0]->backsector->ceilingheight += momz; + // Sal: Remember to check your sectors! + P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage)); + P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage)); } }