- floatified Recon.

This commit is contained in:
Christoph Oelckers 2022-08-22 20:08:45 +02:00
parent 9275c14c9c
commit 8a86cc26b6
2 changed files with 6 additions and 6 deletions

View file

@ -1880,8 +1880,8 @@ void reactor(DDukeActor* const actor, int REACTOR, int REACTOR2, int REACTORBURN
{
actor->temp_data[1]++;
actor->temp_data[4] = actor->int_pos().Z;
actor->set_int_z(sectp->int_floorz() - (krand() % (sectp->int_floorz() - sectp->int_ceilingz())));
actor->temp_data[4] = FloatToFixed<8>(actor->spr.pos.Z);
actor->spr.pos.Z = sectp->floorz - zrand(sectp->floorz - sectp->ceilingz);
switch (actor->temp_data[1])
{
@ -1923,7 +1923,7 @@ void reactor(DDukeActor* const actor, int REACTOR, int REACTOR2, int REACTORBURN
for (x = 0; x < 16; x++)
RANDOMSCRAP(actor);
actor->set_int_z(actor->temp_data[4]);
actor->spr.pos.Z = FixedToFloat<8>(actor->temp_data[4]);
actor->temp_data[4] = 0;
}

View file

@ -252,10 +252,10 @@ inline double zrand(int spread, int ofs)
return r * zmaptoworld;
}
inline double zrand(int spread)
inline double zrand(double spread)
{
int r = krand() % (spread << 8);
return r * zmaptoworld;
int r = krand() % FloatToFixed<8>(spread);
return FixedToFloat<8>(r);
}
END_DUKE_NS