mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Initialize oldxp/oldyp in createentity()
This prevents undefined behavior because we use oldxp/oldyp to do linear interpolation. It's also initialized in entclass::entclass(), just to be sure. And I've deduplicated the regular xp/yp initialization in createentity(), too.
This commit is contained in:
@@ -27,6 +27,8 @@ entclass::entclass()
|
||||
cy = 0;
|
||||
newxp = 0;
|
||||
newyp = 0;
|
||||
oldxp = 0;
|
||||
oldyp = 0;
|
||||
|
||||
x1 = 0;
|
||||
y1 = 0;
|
||||
@@ -99,6 +101,7 @@ void entclass::setenemy( int t )
|
||||
else if ( (para) == 1)
|
||||
{
|
||||
yp += 10;
|
||||
oldyp += 10;
|
||||
tile = 63;
|
||||
animate = 100; //LIES
|
||||
colour = 6;
|
||||
@@ -138,7 +141,9 @@ void entclass::setenemy( int t )
|
||||
else if ( (para) == 1)
|
||||
{
|
||||
xp += 4;
|
||||
oldxp += 4;
|
||||
yp -= 4;
|
||||
oldyp -= 4;
|
||||
tile = 76;
|
||||
animate = 100; // Clouds
|
||||
colour = 6;
|
||||
|
||||
Reference in New Issue
Block a user