mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Move crewmate drawframe fix to entity creation instead of loadlevel
This makes it so the fix for crewmates' drawframes being wrong for 1-frame is fixed for all crewmates regardless of when they get created. Sure, crewmates created in mapclass::loadlevel() have their drawframes fixed there, but for crewmates that get created from scripting (such as Violet when gotorooming to the Ship teleporter room after Space Station 1), this fix doesn't apply to them. But now it does, and Violet will no longer be facing the wrong way for 1 frame when teleporting to the Ship teleporter room in the Space Station 1 Level Complete cutscene.
This commit is contained in:
@@ -2084,37 +2084,6 @@ void mapclass::loadlevel(int rx, int ry)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Make sure our crewmates are facing the player if appliciable
|
||||
//Also make sure they're flipped if they're flipped
|
||||
for (size_t i = 0; i < obj.entities.size(); i++)
|
||||
{
|
||||
if (obj.entities[i].rule == 6 || obj.entities[i].rule == 7)
|
||||
{
|
||||
if (obj.entities[i].tile == 144 || obj.entities[i].tile == 144+6)
|
||||
{
|
||||
obj.entities[i].drawframe = 144;
|
||||
}
|
||||
if (obj.entities[i].state == 18)
|
||||
{
|
||||
//face the player
|
||||
int j = obj.getplayer();
|
||||
if (j > -1 && obj.entities[j].xp > obj.entities[i].xp + 5)
|
||||
{
|
||||
obj.entities[i].dir = 1;
|
||||
}
|
||||
else if (j > -1 && obj.entities[j].xp < obj.entities[i].xp - 5)
|
||||
{
|
||||
obj.entities[i].dir = 0;
|
||||
obj.entities[i].drawframe += 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (obj.entities[i].rule == 7)
|
||||
{
|
||||
obj.entities[i].drawframe += 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void mapclass::twoframedelayfix()
|
||||
|
||||
Reference in New Issue
Block a user