diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 32308a2bb..89c79829f 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1744,11 +1744,8 @@ inline Collision move_sprite(DSWActor* actor, const DVector3& change, double cei return move_sprite(actor, change.X * worldtoint, change.Y * worldtoint, change.Z * zworldtoint, ceildist * zworldtoint, flordist * zworldtoint, cliptype, numtics); } -Collision move_missile(DSWActor*, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics); -inline Collision move_missile(DSWActor* actor, const DVector3& change, double ceildist, double flordist, uint32_t cliptype, int numtics) -{ - return move_missile(actor, change.X * worldtoint, change.Y * worldtoint, change.Z * zworldtoint, ceildist * zworldtoint, flordist * zworldtoint, cliptype, numtics); -} +Collision move_missile(DSWActor* actor, const DVector3& change, double ceildist, double flordist, uint32_t cliptype, int numtics); + DSWActor* DoPickTarget(DSWActor*, uint32_t max_delta_ang, int skip_targets); diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 6d4914961..839e132e6 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -6390,10 +6390,8 @@ int MissileZrange(DSWActor* actor) } -Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics) +Collision move_missile(DSWActor* actor, const DVector3& change, double ceil_dist, double flor_dist, uint32_t cliptype, int numtics) { - double ceil_dist = ceildist * zinttoworld, flor_dist = flordist * zinttoworld; - Collision retval{}; double zH; @@ -6417,9 +6415,10 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i } + int xchange = change.X * worldtoint, ychange = change.Y * worldtoint; clipmove(clip_pos, &dasect, ((xchange * numtics) << 11), ((ychange * numtics) << 11), - (((int) actor->spr.clipdist) << 2), ceildist, flordist, cliptype, retval, 1); + (((int) actor->spr.clipdist) << 2), ceil_dist, flor_dist, cliptype, retval, 1); actor->spr.pos.XY() = clip_pos.XY(); if (dasect == nullptr) @@ -6447,7 +6446,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i // missiles don't need the water to be down MissileWaterAdjust(actor); - clip_pos.Z = actor->spr.pos.Z + ((zchange * numtics) >> 3) * zinttoworld; + clip_pos.Z = actor->spr.pos.Z + ((change.Z * numtics) * 0.125); // NOTE: this does not tell you when you hit a floor sprite // this case is currently treated like it hit a sector