From 0b920ee2492566d245c93f7a624418b6896e9080 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 9 Jun 2016 00:02:50 +0100 Subject: [PATCH] You know that problem where you bumped on the edges of Mario blocks and Bustable blocks and Bouncy FOFs sometimes? Wham. Bam. In the van. Issue was caused by attempting to traverse the sector's thing-touching-list across all the things in the sector (which would inevitably have the same sector as the first node in mobj->touching_sectorlist) instead of traversing the thing's sector-touching-list (which has the same thing but different sector references). I wonder how many times AJ copypasted this code with absolutely no idea why it wasn't working properly. I'll figure that out tomorrow, maybe set up some compiler macros so this mistake is never made again. For now, I must sleeb. --- src/p_mobj.c | 4 ++-- src/p_user.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 68fb1696f..759fa0d8c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1530,7 +1530,7 @@ static void P_PushableCheckBustables(mobj_t *mo) mo->y += mo->momy; P_SetThingPosition(mo); - for (node = mo->touching_sectorlist; node; node = node->m_snext) + for (node = mo->touching_sectorlist; node; node = node->m_tnext) { if (!node->m_sector) break; @@ -2880,7 +2880,7 @@ nightsdone: if (CheckForMarioBlocks && !(netgame && mo->player->spectator)) // Only let the player punch { // Search the touching sectors, from side-to-side... - for (node = mo->touching_sectorlist; node; node = node->m_snext) + for (node = mo->touching_sectorlist; node; node = node->m_tnext) { ffloor_t *rover; if (!node->m_sector->ffloors) diff --git a/src/p_user.c b/src/p_user.c index 4117cfc4c..fab8cd37e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1684,7 +1684,7 @@ static void P_CheckBustableBlocks(player_t *player) player->mo->y += player->mo->momy; P_SetThingPosition(player->mo); - for (node = player->mo->touching_sectorlist; node; node = node->m_snext) + for (node = player->mo->touching_sectorlist; node; node = node->m_tnext) { if (!node->m_sector) break; @@ -1801,7 +1801,7 @@ static void P_CheckBouncySectors(player_t *player) player->mo->z += player->mo->momz; P_SetThingPosition(player->mo); - for (node = player->mo->touching_sectorlist; node; node = node->m_snext) + for (node = player->mo->touching_sectorlist; node; node = node->m_tnext) { if (!node->m_sector) break;