1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-02 02:53:32 +02:00

Re-fix glitchy y-position when spawning onto a conveyor

This is a re-do of 942217f871 (#509), but
with a more conservative fix that only resets the player's newxp and
newyp when they respawn from a checkpoint or spawn in to the map.

Unlike the previous patch, if the player were to suddenly collide with a
conveyor or horizontally-moving platform during gameplay, their
y-position would revert back to the intended next y-position of the
previous frame. But this is the same behavior as before, I haven't ever
seen such a contrived situation come up, and this behavior is probably
more preferable for gameplay than actually going to the conveyor, so
it's fine.

I also decided to reset newxp here, and not just newyp, because while
resetting newyp seems to be enough, it's safer to also reset newxp (and
so future readers won't question why only newyp is reset but not newxp).

I tested this and it once again fixes the death loop issue from earlier,
while also still allowing for that Trench Warfare trick to be possible
(I tested it with the libTAS movie I mentioned in #606; it syncs fine).
There are no other known regressions resulting from this fix
(hopefully).
This commit is contained in:
Misa 2021-02-01 16:16:04 -08:00 committed by Ethan Lee
parent a406b99f4b
commit 3bc3b59378

View File

@ -775,6 +775,11 @@ void mapclass::resetplayer(const bool player_died)
obj.entities[i].ay = 0;
obj.entities[i].xp = game.savex;
obj.entities[i].yp = game.savey;
//Fix conveyor death loop glitch
obj.entities[i].newxp = obj.entities[i].xp;
obj.entities[i].newyp = obj.entities[i].yp;
obj.entities[i].dir = game.savedir;
obj.entities[i].colour = 0;
if (player_died)