diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index d938657da..3a243f379 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1035,7 +1035,7 @@ struct USER int16_t BladeDamageTics; unsigned int Radius; // for distance checking - int OverlapZ; // for z overlap variable + double OverlapZ; // for z overlap variable // // Only have a place for actors diff --git a/source/games/sw/src/skull.cpp b/source/games/sw/src/skull.cpp index ddfdeda88..eca32da4b 100644 --- a/source/games/sw/src/skull.cpp +++ b/source/games/sw/src/skull.cpp @@ -329,7 +329,7 @@ int DoSkullBeginDeath(DSWActor* actor) actor->user.Tics = 0; actor->user.ID = SKULL_R0; actor->user.Radius = DamageData[DMG_SKULL_EXP].radius; //*DamageRadiusSkull; - actor->user.OverlapZ = Z(64); + actor->user.OverlapZ = 64; change_actor_stat(actor, STAT_DEAD_ACTOR); actor->spr.shade = -40; @@ -698,7 +698,7 @@ int DoBettyBeginDeath(DSWActor* actor) actor->user.Tics = 0; actor->user.ID = BETTY_R0; actor->user.Radius = DamageData[DMG_SKULL_EXP].radius; //*DamageRadiusBetty; - actor->user.OverlapZ = Z(64); + actor->user.OverlapZ = 64; change_actor_stat(actor, STAT_DEAD_ACTOR); actor->spr.shade = -40; diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 461eb083d..b4adf36ce 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -843,7 +843,7 @@ void SpawnUser(DSWActor* actor, short id, STATE* state) actor->user.Radius = 220; actor->user.Sibling = -1; actor->user.WaitTics = 0; - actor->user.OverlapZ = Z(4); + actor->user.OverlapZ = 4; actor->user.bounce = 0; actor->user.motion_blur_num = 0; @@ -4255,22 +4255,18 @@ int NewStateGroup(DSWActor* actor, STATE* StateGroup[]) bool SpriteOverlap(DSWActor* actor_a, DSWActor* actor_b) { - int spa_tos, spa_bos, spb_tos, spb_bos, overlap_z; - if (!actor_a->hasU() || !actor_b->hasU()) return false; if ((unsigned)DistanceI(actor_a->spr.pos, actor_b->spr.pos) > actor_a->user.Radius + actor_b->user.Radius) { return false; } - spa_tos = int_ActorZOfTop(actor_a); - spa_bos = int_ActorZOfBottom(actor_a); + double spa_tos = ActorZOfTop(actor_a); + double spa_bos = ActorZOfBottom(actor_a); + double spb_tos = ActorZOfTop(actor_b); + double spb_bos = ActorZOfBottom(actor_b); - spb_tos = int_ActorZOfTop(actor_b); - spb_bos = int_ActorZOfBottom(actor_b); - - - overlap_z = actor_a->user.OverlapZ + actor_b->user.OverlapZ; + double overlap_z = actor_a->user.OverlapZ + actor_b->user.OverlapZ; // if the top of sprite a is below the bottom of b if (spa_tos - overlap_z > spb_bos)