diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 5fb62b7c4..44c8562b1 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -2250,9 +2250,9 @@ inline bool Facing(DSWActor* actor1, DSWActor* actor2) } // Given a z height and sprite return the correct y repeat value -inline int GetRepeatFromHeight(DSWActor* sp, int zh) +inline int GetRepeatFromHeight(DSWActor* sp, double zh) { - return zh / (4 * tileHeight(sp->spr.picnum)); + return int(zh * 64) / tileHeight(sp->spr.picnum); } inline bool SpriteInDiveArea(DSWActor* a) diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index 4abdd6e1a..cf203d69e 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -1494,7 +1494,7 @@ void SpawnFlashBombOnActor(DSWActor* actor) DSWActor* flameActor = actor->user.flameActor; if (flameActor != nullptr) { - int sizez = (int_ActorSizeZ(actor) * 5) >> 2; + double sizez = ActorSizeZ(actor) * 1.25; if (flameActor->user.Counter >= GetRepeatFromHeight(flameActor, sizez)) { @@ -1504,7 +1504,7 @@ void SpawnFlashBombOnActor(DSWActor* actor) else { // increase max size - flameActor->user.Counter += GetRepeatFromHeight(flameActor, 8 << 8) * 2; + flameActor->user.Counter += GetRepeatFromHeight(flameActor, 8) * 2; } // Counter is max size @@ -1532,7 +1532,7 @@ void SpawnFlashBombOnActor(DSWActor* actor) if (actor->user.flameActor != nullptr) { - actorNew->user.Counter = GetRepeatFromHeight(actorNew, int_ActorSizeZ(actor) >> 1) * 4; + actorNew->user.Counter = GetRepeatFromHeight(actorNew, ActorSizeZ(actor) * 0.5) * 4; } else actorNew->user.Counter = 0; // max flame size diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 4c562ab4d..eb60623a0 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -9596,7 +9596,7 @@ void SpawnFireballFlames(DSWActor* actor, DSWActor* enemyActor) auto flameActor = enemyActor->user.flameActor; if (flameActor != nullptr) { - int sizez = int_ActorSizeZ(enemyActor) + (int_ActorSizeZ(enemyActor) >> 2); + double sizez = ActorSizeZ(enemyActor) + (ActorSizeZ(enemyActor) * 0.25); if ((enemyActor->spr.extra & SPRX_BURNABLE)) return; @@ -9609,7 +9609,7 @@ void SpawnFireballFlames(DSWActor* actor, DSWActor* enemyActor) else { //increase max size - flameActor->user.Counter += GetRepeatFromHeight(flameActor, 8<<8); + flameActor->user.Counter += GetRepeatFromHeight(flameActor, 8); } // Counter is max size @@ -9640,12 +9640,12 @@ void SpawnFireballFlames(DSWActor* actor, DSWActor* enemyActor) // large flame for trees and such if ((enemyActor->spr.extra & SPRX_BURNABLE)) { - int sizez = int_ActorSizeZ(enemyActor) + (int_ActorSizeZ(enemyActor) >> 2); + double sizez = ActorSizeZ(enemyActor) + (ActorSizeZ(enemyActor) * 0.25); actorNew->user.Counter = GetRepeatFromHeight(actorNew, sizez); } else { - actorNew->user.Counter = GetRepeatFromHeight(actorNew, int_ActorSizeZ(enemyActor)>>1); + actorNew->user.Counter = GetRepeatFromHeight(actorNew, ActorSizeZ(enemyActor) * 0.5); } } else