mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-22 08:49:46 +01:00
Set oldxp/oldyp when being teleported around during teleport
This fixes the bug where Viridian would appear to "zip" when they would be teleported to the position of the teleporter before being flung out of it. As discussed in #393, I've also set the oldxp/oldyp when Viridian is temporarily positioned in the center of the room, even though at this point they should already be invisible. This is just to be safe. Fixes #393.
This commit is contained in:
parent
52f7a587fe
commit
fdb01adc68
2 changed files with 22 additions and 0 deletions
|
@ -1979,6 +1979,8 @@ void Game::updatestate()
|
|||
{
|
||||
obj.entities[i].xp = obj.entities[j].xp+44;
|
||||
obj.entities[i].yp = obj.entities[j].yp+44;
|
||||
obj.entities[i].oldxp = obj.entities[i].xp;
|
||||
obj.entities[i].oldyp = obj.entities[i].yp;
|
||||
}
|
||||
obj.entities[i].ay = -6;
|
||||
obj.entities[i].ax = 6;
|
||||
|
@ -3322,6 +3324,8 @@ void Game::updatestate()
|
|||
{
|
||||
obj.entities[i].xp = obj.entities[j].xp+44;
|
||||
obj.entities[i].yp = obj.entities[j].yp+44;
|
||||
obj.entities[i].oldxp = obj.entities[i].xp;
|
||||
obj.entities[i].oldyp = obj.entities[i].yp;
|
||||
obj.entities[j].tile = 2;
|
||||
obj.entities[j].colour = 101;
|
||||
}
|
||||
|
@ -3435,6 +3439,8 @@ void Game::updatestate()
|
|||
{
|
||||
obj.entities[i].xp = obj.entities[j].xp+44;
|
||||
obj.entities[i].yp = obj.entities[j].yp+44;
|
||||
obj.entities[i].oldxp = obj.entities[i].xp;
|
||||
obj.entities[i].oldyp = obj.entities[i].yp;
|
||||
obj.entities[j].tile = 2;
|
||||
obj.entities[j].colour = 101;
|
||||
}
|
||||
|
@ -3532,6 +3538,8 @@ void Game::updatestate()
|
|||
{
|
||||
obj.entities[i].xp = obj.entities[j].xp+44;
|
||||
obj.entities[i].yp = obj.entities[j].yp+44;
|
||||
obj.entities[i].oldxp = obj.entities[i].xp;
|
||||
obj.entities[i].oldyp = obj.entities[i].yp;
|
||||
obj.entities[j].tile = 2;
|
||||
obj.entities[j].colour = 101;
|
||||
}
|
||||
|
@ -3629,6 +3637,8 @@ void Game::updatestate()
|
|||
{
|
||||
obj.entities[i].xp = obj.entities[j].xp+44;
|
||||
obj.entities[i].yp = obj.entities[j].yp+44;
|
||||
obj.entities[i].oldxp = obj.entities[i].xp;
|
||||
obj.entities[i].oldyp = obj.entities[i].yp;
|
||||
obj.entities[j].tile = 2;
|
||||
obj.entities[j].colour = 101;
|
||||
}
|
||||
|
@ -3731,6 +3741,8 @@ void Game::updatestate()
|
|||
{
|
||||
obj.entities[i].xp = obj.entities[j].xp+44;
|
||||
obj.entities[i].yp = obj.entities[j].yp+44;
|
||||
obj.entities[i].oldxp = obj.entities[i].xp;
|
||||
obj.entities[i].oldyp = obj.entities[i].yp;
|
||||
obj.entities[j].tile = 2;
|
||||
obj.entities[j].colour = 101;
|
||||
}
|
||||
|
@ -3833,6 +3845,8 @@ void Game::updatestate()
|
|||
{
|
||||
obj.entities[i].xp = obj.entities[j].xp+44;
|
||||
obj.entities[i].yp = obj.entities[j].yp+44;
|
||||
obj.entities[i].oldxp = obj.entities[i].xp;
|
||||
obj.entities[i].oldyp = obj.entities[i].yp;
|
||||
obj.entities[j].tile = 2;
|
||||
obj.entities[j].colour = 101;
|
||||
}
|
||||
|
@ -3933,6 +3947,8 @@ void Game::updatestate()
|
|||
{
|
||||
obj.entities[i].xp = obj.entities[j].xp+44;
|
||||
obj.entities[i].yp = obj.entities[j].yp+44;
|
||||
obj.entities[i].oldxp = obj.entities[i].xp;
|
||||
obj.entities[i].oldyp = obj.entities[i].yp;
|
||||
obj.entities[j].tile = 2;
|
||||
obj.entities[j].colour = 101;
|
||||
}
|
||||
|
@ -4030,6 +4046,8 @@ void Game::updatestate()
|
|||
{
|
||||
obj.entities[i].xp = obj.entities[j].xp+44;
|
||||
obj.entities[i].yp = obj.entities[j].yp+44;
|
||||
obj.entities[i].oldxp = obj.entities[i].xp;
|
||||
obj.entities[i].oldyp = obj.entities[i].yp;
|
||||
obj.entities[j].tile = 2;
|
||||
obj.entities[j].colour = 101;
|
||||
}
|
||||
|
@ -4127,6 +4145,8 @@ void Game::updatestate()
|
|||
{
|
||||
obj.entities[i].xp = obj.entities[j].xp+44;
|
||||
obj.entities[i].yp = obj.entities[j].yp+44;
|
||||
obj.entities[i].oldxp = obj.entities[i].xp;
|
||||
obj.entities[i].oldyp = obj.entities[i].yp;
|
||||
obj.entities[j].tile = 2;
|
||||
obj.entities[j].colour = 101;
|
||||
}
|
||||
|
|
|
@ -3427,6 +3427,8 @@ void scriptclass::teleport()
|
|||
obj.entities[i].xp = 150;
|
||||
obj.entities[i].yp = 110;
|
||||
if(game.teleport_to_x==17 && game.teleport_to_y==17) obj.entities[i].xp = 88; //prevent falling!
|
||||
obj.entities[i].oldxp = obj.entities[i].xp;
|
||||
obj.entities[i].oldyp = obj.entities[i].yp;
|
||||
}
|
||||
|
||||
if (game.teleportscript == "levelonecomplete")
|
||||
|
|
Loading…
Reference in a new issue