mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Only process tapleft
/tapright
if has_control
This fixes a regression where the game ignored the amount of frames you held down a direction if you released the direction during death. Previously, the game only checked the amount of frames you held down a direction if you were able to control the player. If you weren't able to control the player (e.g. during the death animation), then the number of frames it counted didn't change. This also meant that if you were holding a direction before you died, but released it during death, the game wouldn't zero out the number of frames you held it. This behavior was useful because it meant you could keep the deceleration momentum that you normally get by holding a direction for 5 frames just by holding a direction for less than 5 frames after dying, if you had the rest of the hold frames before you died. This behavior is what's used in https://tasvideos.org/7575S at around frame 7200. Unfortunately, #609 made it so that the direction hold processing happened even if the player didn't have control, meaning that it would zero the hold frames during the death animation in the TAS, thus desyncing it when it performed the maneuver it relied on the extra momentum for after Viridian respawns. The solution here is to just add the check back in again. Fixes #887.
This commit is contained in:
parent
c3750e3b34
commit
67d350de05
1 changed files with 43 additions and 43 deletions
|
@ -2240,51 +2240,51 @@ void gameinput(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (game.press_left)
|
||||
{
|
||||
game.tapleft++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (game.tapleft <= 4 && game.tapleft > 0)
|
||||
{
|
||||
for (size_t ie = 0; ie < obj.entities.size(); ++ie)
|
||||
{
|
||||
if (obj.entities[ie].rule == 0)
|
||||
{
|
||||
if (obj.entities[ie].vx < 0.0f)
|
||||
{
|
||||
obj.entities[ie].vx = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
game.tapleft = 0;
|
||||
}
|
||||
if (game.press_right)
|
||||
{
|
||||
game.tapright++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (game.tapright <= 4 && game.tapright > 0)
|
||||
{
|
||||
for (size_t ie = 0; ie < obj.entities.size(); ++ie)
|
||||
{
|
||||
if (obj.entities[ie].rule == 0)
|
||||
{
|
||||
if (obj.entities[ie].vx > 0.0f)
|
||||
{
|
||||
obj.entities[ie].vx = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
game.tapright = 0;
|
||||
}
|
||||
|
||||
if (has_control)
|
||||
{
|
||||
if (game.press_left)
|
||||
{
|
||||
game.tapleft++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (game.tapleft <= 4 && game.tapleft > 0)
|
||||
{
|
||||
for (size_t ie = 0; ie < obj.entities.size(); ++ie)
|
||||
{
|
||||
if (obj.entities[ie].rule == 0)
|
||||
{
|
||||
if (obj.entities[ie].vx < 0.0f)
|
||||
{
|
||||
obj.entities[ie].vx = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
game.tapleft = 0;
|
||||
}
|
||||
if (game.press_right)
|
||||
{
|
||||
game.tapright++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (game.tapright <= 4 && game.tapright > 0)
|
||||
{
|
||||
for (size_t ie = 0; ie < obj.entities.size(); ++ie)
|
||||
{
|
||||
if (obj.entities[ie].rule == 0)
|
||||
{
|
||||
if (obj.entities[ie].vx > 0.0f)
|
||||
{
|
||||
obj.entities[ie].vx = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
game.tapright = 0;
|
||||
}
|
||||
|
||||
if (!game.press_action)
|
||||
{
|
||||
game.jumppressed = 0;
|
||||
|
|
Loading…
Reference in a new issue