From 935c0da7d2353585a4f1e326841b50f02576a04d Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 6 Nov 2018 13:33:27 +0000 Subject: [PATCH] Fix startbumps. A more detailed explanation: * P_CheckPosition is the function which determines collisions. * In Vanilla, collisions do not happen between players unless tailspickup is off (which it basically never is). * Even with tailspickup off, on-spawn player collisions do not affect momentum. * However, in kart, player collisions cause the player to get bumped. * It would succeed at the P_CheckPosition call because players aren't *solid* solid, even though they cause bumps. * It would fail at the K_CheckPlayersRespawnColliding call, but that would be too late, *as the player already has been bumped.* * The player would therefore be moved to a new location, but still retain bump momentum, and the bump sound would have played for both players. * Therefore, the obvious solution is to swap P_CheckPosition and K_CheckPlayersRespawnColliding, so that it checks for players BEFORE it performs object collisions at that spot. * The reason we didn't see this MUCH before is that it can only ever happen in the case of ties. I could've easily done this into master, but obviously I figure yalls'd at least like to check this first. --- src/g_game.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index fecef69a..61ccb23c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2621,10 +2621,10 @@ static boolean G_CheckSpot(INT32 playernum, mapthing_t *mthing) x = mthing->x << FRACBITS; y = mthing->y << FRACBITS; - if (!P_CheckPosition(players[playernum].mo, x, y)) + if (!K_CheckPlayersRespawnColliding(playernum, x, y)) return false; - if (!K_CheckPlayersRespawnColliding(playernum, x, y)) + if (!P_CheckPosition(players[playernum].mo, x, y)) return false; return true;