mirror of
https://github.com/dwsJason/xrick2gs.git
synced 2024-09-28 05:56:40 +00:00
fix numerical issues with enemy movement
This commit is contained in:
parent
811810ddfd
commit
f6ea147ed4
@ -110,7 +110,7 @@ e_them_t1_action2(U8 e, U8 type)
|
||||
U8 env0, env1;
|
||||
|
||||
/* by default, try vertical move. calculate new y */
|
||||
i = (ent_ents[e].y << 8) + ent_ents[e].offsy + ent_ents[e].ylow;
|
||||
i = (((S32)ent_ents[e].y) << 8) + ((S32)ent_ents[e].offsy) + ((U32)ent_ents[e].ylow);
|
||||
y = i >> 8;
|
||||
|
||||
/* deactivate if outside vertical boundaries */
|
||||
@ -294,7 +294,7 @@ e_them_z_action(U8 e)
|
||||
+ ((ent_ents[e].x & 0x04) ? 0x07 : 0x06);
|
||||
|
||||
/* calc new y */
|
||||
i = (ent_ents[e].y << 8) + ent_ents[e].offsy + ent_ents[e].ylow;
|
||||
i = (((S32)ent_ents[e].y) << 8) + ((S32)ent_ents[e].offsy) + ((U32)ent_ents[e].ylow);
|
||||
|
||||
/* deactivate if out of vertical boundaries */
|
||||
if (ent_ents[e].y < 0 || ent_ents[e].y > 0x0140) {
|
||||
|
Loading…
Reference in New Issue
Block a user