- only use the floatified version of findplayer.

This commit is contained in:
Christoph Oelckers 2022-09-14 22:49:01 +02:00
parent 1fdfe4635b
commit 201526b53c

View file

@ -415,7 +415,7 @@ void moveplayers(void)
other = 0; other = 0;
} }
execute(act, pn, other * worldtoint); execute(act, pn, other);
if (ud.multimode > 1) if (ud.multimode > 1)
{ {
@ -624,7 +624,7 @@ void movecrane(DDukeActor *actor, int crane)
{ {
const double CRANE_STEP = 16.; const double CRANE_STEP = 16.;
auto sectp = actor->sector(); auto sectp = actor->sector();
int x; double xx;
auto& cpt = cranes[actor->temp_data[4]]; auto& cpt = cranes[actor->temp_data[4]];
//actor->temp_data[0] = state //actor->temp_data[0] = state
@ -684,7 +684,7 @@ void movecrane(DDukeActor *actor, int crane)
{ {
if (actor->IsActiveCrane()) if (actor->IsActiveCrane())
{ {
int p = findplayer(actor, &x); int p = findplayer(actor, &xx);
S_PlayActorSound(isRR() ? 390 : DUKE_GRUNT, ps[p].GetActor()); S_PlayActorSound(isRR() ? 390 : DUKE_GRUNT, ps[p].GetActor());
if (ps[p].on_crane == actor) if (ps[p].on_crane == actor)
ps[p].on_crane = nullptr; ps[p].on_crane = nullptr;
@ -767,7 +767,7 @@ void movecrane(DDukeActor *actor, int crane)
auto Owner = actor->GetOwner(); auto Owner = actor->GetOwner();
if (Owner != nullptr || actor->IsActiveCrane()) if (Owner != nullptr || actor->IsActiveCrane())
{ {
int p = findplayer(actor, &x); int p = findplayer(actor, &xx);
int j = fi.ifhitbyweapon(actor); int j = fi.ifhitbyweapon(actor);
if (j >= 0) if (j >= 0)
@ -808,7 +808,6 @@ void movecrane(DDukeActor *actor, int crane)
void movefountain(DDukeActor *actor, int fountain) void movefountain(DDukeActor *actor, int fountain)
{ {
int x;
if (actor->temp_data[0] > 0) if (actor->temp_data[0] > 0)
{ {
if (actor->temp_data[0] < 20) if (actor->temp_data[0] < 20)
@ -822,9 +821,10 @@ void movefountain(DDukeActor *actor, int fountain)
} }
else else
{ {
double x;
findplayer(actor, &x); findplayer(actor, &x);
if (x > 512) if (x > 32)
{ {
actor->temp_data[0] = 0; actor->temp_data[0] = 0;
actor->spr.picnum = fountain; actor->spr.picnum = fountain;
@ -1653,8 +1653,8 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
actor->spr.pos.Z = actor->floorz - 48; actor->spr.pos.Z = actor->floorz - 48;
} }
int x; double xx;
int p = findplayer(actor, &x); int p = findplayer(actor, &xx);
auto Owner = actor->GetOwner(); auto Owner = actor->GetOwner();
// 3 = findplayerz, 4 = shoot // 3 = findplayerz, 4 = shoot
@ -1735,7 +1735,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
if (actor->temp_data[0] < 2) actor->temp_data[2]++; if (actor->temp_data[0] < 2) actor->temp_data[2]++;
if (x < 6144 && actor->temp_data[0] < 2 && actor->temp_data[2] > (26 * 4)) if (xx < 384 && actor->temp_data[0] < 2 && actor->temp_data[2] > (26 * 4))
{ {
actor->temp_data[0] = 2 + (krand() & 2); actor->temp_data[0] = 2 + (krand() & 2);
actor->temp_data[2] = 0; actor->temp_data[2] = 0;
@ -1846,13 +1846,13 @@ void reactor(DDukeActor* const actor, int REACTOR, int REACTOR2, int REACTORBURN
return; return;
} }
int x; double xx;
int p = findplayer(actor, &x); int p = findplayer(actor, &xx);
actor->temp_data[2]++; actor->temp_data[2]++;
if (actor->temp_data[2] == 4) actor->temp_data[2] = 0; if (actor->temp_data[2] == 4) actor->temp_data[2] = 0;
if (x < 4096) if (xx < 256)
{ {
if ((krand() & 255) < 16) if ((krand() & 255) < 16)
{ {
@ -1914,7 +1914,7 @@ void reactor(DDukeActor* const actor, int REACTOR, int REACTOR2, int REACTORBURN
break; break;
} }
} }
for (x = 0; x < 16; x++) for (int x = 0; x < 16; x++)
RANDOMSCRAP(actor); RANDOMSCRAP(actor);
actor->spr.pos.Z = FixedToFloat<8>(actor->temp_data[4]); actor->spr.pos.Z = FixedToFloat<8>(actor->temp_data[4]);
@ -1926,7 +1926,7 @@ void reactor(DDukeActor* const actor, int REACTOR, int REACTOR2, int REACTORBURN
int j = fi.ifhitbyweapon(actor); int j = fi.ifhitbyweapon(actor);
if (j >= 0) if (j >= 0)
{ {
for (x = 0; x < 32; x++) for (int x = 0; x < 32; x++)
RANDOMSCRAP(actor); RANDOMSCRAP(actor);
if (actor->spr.extra < 0) if (actor->spr.extra < 0)
actor->temp_data[1] = 1; actor->temp_data[1] = 1;