1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Move general oldxp/oldyp updating to just before gameinput()

This has to be done in order to fix rendering when on a conveyor or
moving platform and actively moving with or against it. Pretty sure this
shouldn't break anything, oldxp/oldyp is mostly visual after all (and by
the time it's used for gravity line collision checking,
updateentitylogic() would've already gotten around to it anyway).

Incidentally, this also fixes a jitter that would occur if you were
moving at the time you died or collected a trinket or custom crewmate,
due to the game temporarily freezing and either doing deathsequence or
completestop.
This commit is contained in:
Misa 2020-04-28 21:06:56 -07:00 committed by Ethan Lee
parent 3b41721563
commit 40cedc8c94
2 changed files with 7 additions and 3 deletions

View file

@ -4343,9 +4343,6 @@ void entityclass::updateentitylogic( int t )
return;
}
entities[t].oldxp = entities[t].xp;
entities[t].oldyp = entities[t].yp;
entities[t].vx = entities[t].vx + entities[t].ax;
entities[t].vy = entities[t].vy + entities[t].ay;
entities[t].ax = 0;

View file

@ -417,6 +417,13 @@ int main(int argc, char *argv[])
script.run();
}
//Update old positions of entities - has to be done BEFORE gameinput!
for (size_t i = 0; i < obj.entities.size(); i++)
{
obj.entities[i].oldxp = obj.entities[i].xp;
obj.entities[i].oldyp = obj.entities[i].yp;
}
gameinput();
gamelogic();