# HG changeset patch # User Adam Kaminski # Date 1644163138 18000 # Sun Feb 06 10:58:58 2022 -0500 # Node ID 61c857ef8c6b6f9df38ff43bbe73172ef79e012c # Parent 20c0c1d4eff246cf34f00f632151be39d7598def Fixed: players appeared jittery when standing on lifts moving downward in online games. diff -r 20c0c1d4eff2 -r 61c857ef8c6b src/cl_main.cpp --- a/src/cl_main.cpp Thu Feb 10 09:50:28 2022 -0500 +++ b/src/cl_main.cpp Sun Feb 06 10:58:58 2022 -0500 @@ -3799,6 +3799,19 @@ // [BB] But don't just set the position, but also properly set floorz and ceilingz, etc. CLIENT_MoveThing( player->mo, x, y, z ); + // [AK] Did the server tell us this player is supposed to be on a moving lift? If so, move + // them to the floor of whatever sector they're in. + if ( flags & PLAYER_ONLIFT ) + { + // [AK] When the player is standing on the edge of a moving lift, their floorz might be + // messed up and lower than it actually is, so we have to fix it. + player->mo->floorz = player->mo->Sector->floorplane.ZatPoint( player->mo->x, player->mo->y ); + player->mo->ceilingz = player->mo->Sector->ceilingplane.ZatPoint( player->mo->x, player->mo->y ); + P_FindFloorCeiling( player->mo, false ); + + player->mo->z = player->mo->floorz; + } + // [AK] Calculate how much this player's angle changed. player->mo->AngleDelta = angle - player->mo->angle; diff -r 20c0c1d4eff2 -r 61c857ef8c6b src/network.h --- a/src/network.h Thu Feb 10 09:50:28 2022 -0500 +++ b/src/network.h Sun Feb 06 10:58:58 2022 -0500 @@ -92,6 +92,7 @@ PLAYER_SENDVELX = 1 << 4, PLAYER_SENDVELY = 1 << 5, PLAYER_SENDVELZ = 1 << 6, + PLAYER_ONLIFT = 1 << 7, }; /* [BB] This is not used anywhere anymore. diff -r 20c0c1d4eff2 -r 61c857ef8c6b src/sv_commands.cpp --- a/src/sv_commands.cpp Thu Feb 10 09:50:28 2022 -0500 +++ b/src/sv_commands.cpp Sun Feb 06 10:58:58 2022 -0500 @@ -313,6 +313,11 @@ if ( players[ulPlayer].mo->velz ) ulPlayerFlags |= PLAYER_SENDVELZ; + // [AK] Check if the player is standing on a moving lift. This tells clients to clamp the player onto + // the floor of whatever sector they end up in, making them not appeary jittery on lifts moving downward. + if (( players[ulPlayer].mo->z <= players[ulPlayer].mo->floorz ) && ( players[ulPlayer].mo->floorsector->floordata )) + ulPlayerFlags |= PLAYER_ONLIFT; + ServerCommands::MovePlayer fullCommand; fullCommand.SetPlayer ( &players[ulPlayer] ); fullCommand.SetFlags( ulPlayerFlags | PLAYER_VISIBLE );