- floatified move_missile’s API

This commit is contained in:
Christoph Oelckers 2022-08-31 00:46:24 +02:00
parent e7197e2d73
commit ce7533c1c4
2 changed files with 6 additions and 10 deletions

View file

@ -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);

View file

@ -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