Revision | ab089e2fed3119ad9ed98363fa8ef46a76f59c9e (tree) |
---|---|
Time | 2022-02-07 00:58:58 |
Author | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Fixed: players appeared jittery when standing on lifts moving downward in online games.
@@ -3799,6 +3799,19 @@ | ||
3799 | 3799 | // [BB] But don't just set the position, but also properly set floorz and ceilingz, etc. |
3800 | 3800 | CLIENT_MoveThing( player->mo, x, y, z ); |
3801 | 3801 | |
3802 | + // [AK] Did the server tell us this player is supposed to be on a moving lift? If so, move | |
3803 | + // them to the floor of whatever sector they're in. | |
3804 | + if ( flags & PLAYER_ONLIFT ) | |
3805 | + { | |
3806 | + // [AK] When the player is standing on the edge of a moving lift, their floorz might be | |
3807 | + // messed up and lower than it actually is, so we have to fix it. | |
3808 | + player->mo->floorz = player->mo->Sector->floorplane.ZatPoint( player->mo->x, player->mo->y ); | |
3809 | + player->mo->ceilingz = player->mo->Sector->ceilingplane.ZatPoint( player->mo->x, player->mo->y ); | |
3810 | + P_FindFloorCeiling( player->mo, false ); | |
3811 | + | |
3812 | + player->mo->z = player->mo->floorz; | |
3813 | + } | |
3814 | + | |
3802 | 3815 | // [AK] Calculate how much this player's angle changed. |
3803 | 3816 | player->mo->AngleDelta = angle - player->mo->angle; |
3804 | 3817 |
@@ -92,6 +92,7 @@ | ||
92 | 92 | PLAYER_SENDVELX = 1 << 4, |
93 | 93 | PLAYER_SENDVELY = 1 << 5, |
94 | 94 | PLAYER_SENDVELZ = 1 << 6, |
95 | + PLAYER_ONLIFT = 1 << 7, | |
95 | 96 | }; |
96 | 97 | |
97 | 98 | /* [BB] This is not used anywhere anymore. |
@@ -313,6 +313,11 @@ | ||
313 | 313 | if ( players[ulPlayer].mo->velz ) |
314 | 314 | ulPlayerFlags |= PLAYER_SENDVELZ; |
315 | 315 | |
316 | + // [AK] Check if the player is standing on a moving lift. This tells clients to clamp the player onto | |
317 | + // the floor of whatever sector they end up in, making them not appeary jittery on lifts moving downward. | |
318 | + if (( players[ulPlayer].mo->z <= players[ulPlayer].mo->floorz ) && ( players[ulPlayer].mo->floorsector->floordata )) | |
319 | + ulPlayerFlags |= PLAYER_ONLIFT; | |
320 | + | |
316 | 321 | ServerCommands::MovePlayer fullCommand; |
317 | 322 | fullCommand.SetPlayer ( &players[ulPlayer] ); |
318 | 323 | fullCommand.SetFlags( ulPlayerFlags | PLAYER_VISIBLE ); |