diff --git a/desktop_version/src/Ent.cpp b/desktop_version/src/Ent.cpp index 840bc310..a8ef5588 100644 --- a/desktop_version/src/Ent.cpp +++ b/desktop_version/src/Ent.cpp @@ -46,6 +46,8 @@ void entclass::clear(void) gravity = false; onground = 0; onroof = 0; + visualonground = 0; + visualonroof = 0; onentity = 0; harmful = false; diff --git a/desktop_version/src/Ent.h b/desktop_version/src/Ent.h index fae13c7b..b1a58774 100644 --- a/desktop_version/src/Ent.h +++ b/desktop_version/src/Ent.h @@ -49,6 +49,7 @@ public: int onground, onroof; //Animation int framedelay, drawframe, walkingframe, dir, actionframe; + int visualonground, visualonroof; int yp;int xp; Uint32 realcol; diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index 68b696a6..fcc35040 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -3379,7 +3379,7 @@ void entityclass::animateentities( int _i ) entities[_i].drawframe=entities[_i].tile+3; } - if(entities[_i].onground>0 || entities[_i].onroof>0) + if(entities[_i].visualonground>0 || entities[_i].visualonroof>0) { if(entities[_i].vx > 0.00f || entities[_i].vx < -0.00f) { @@ -3393,9 +3393,9 @@ void entityclass::animateentities( int _i ) entities[_i].drawframe += entities[_i].walkingframe + 1; } - if (entities[_i].onroof > 0) entities[_i].drawframe += 6; + if (entities[_i].visualonroof > 0) entities[_i].drawframe += 6; // Stuck in a wall? Then default to gravitycontrol - if (entities[_i].onground > 0 && entities[_i].onroof > 0 + if (entities[_i].visualonground > 0 && entities[_i].visualonroof > 0 && game.gravitycontrol == 0) { entities[_i].drawframe -= 6; @@ -3639,7 +3639,7 @@ void entityclass::animateentities( int _i ) entities[_i].drawframe=entities[_i].tile+3; } - if(entities[_i].onground>0 || entities[_i].onroof>0) + if(entities[_i].visualonground>0 || entities[_i].visualonroof>0) { if(entities[_i].vx > 0.0000f || entities[_i].vx < -0.000f) { @@ -3653,7 +3653,7 @@ void entityclass::animateentities( int _i ) entities[_i].drawframe += entities[_i].walkingframe + 1; } - //if (entities[_i].onroof > 0) entities[_i].drawframe += 6; + //if (entities[_i].visualonroof > 0) entities[_i].drawframe += 6; } else { @@ -4489,12 +4489,14 @@ void entityclass::movingplatformfix( int t, int j ) entities[j].yp = entities[t].yp + entities[t].h; entities[j].vy = 0; entities[j].onroof = 2; + entities[j].visualonroof = entities[j].onroof; } else { entities[j].yp = entities[t].yp - entities[j].h-entities[j].cy; entities[j].vy = 0; entities[j].onground = 2; + entities[j].visualonground = entities[j].onground; } } else diff --git a/desktop_version/src/RenderFixed.cpp b/desktop_version/src/RenderFixed.cpp index 1fb3f2ab..2422624e 100644 --- a/desktop_version/src/RenderFixed.cpp +++ b/desktop_version/src/RenderFixed.cpp @@ -45,6 +45,9 @@ void gamerenderfixed(void) obj.entities[i].onroof--; } + obj.entities[i].visualonground = obj.entities[i].onground; + obj.entities[i].visualonroof = obj.entities[i].onroof; + //Animate the entities obj.animateentities(i); }