- fully floatified the crane data.

This commit is contained in:
Christoph Oelckers 2022-02-07 11:00:15 +01:00
parent 9392e31b33
commit 25a048c62f
3 changed files with 12 additions and 13 deletions

View file

@ -640,8 +640,8 @@ void movecrane(DDukeActor *actor, int crane)
case STAT_ZOMBIEACTOR:
case STAT_STANDABLE:
case STAT_PLAYER:
actor->spr.ang = getangle(cpt.pole.X - actor->int_pos().X, cpt.pole.Y - actor->int_pos().Y);
SetActor(a2, vec3_t( cpt.pole.X, cpt.pole.Y, a2->int_pos().Z ));
actor->spr.ang = getangle(cpt.pole - actor->spr.pos.XY());
SetActor(a2, DVector3( cpt.pole.X, cpt.pole.Y, a2->spr.pos.Z ));
actor->temp_data[0]++;
return;
}
@ -737,7 +737,7 @@ void movecrane(DDukeActor *actor, int crane)
if ((sectp->floorz - actor->spr.pos.Z) > 32)
actor->spr.picnum++;
if (actor->int_pos().Z < cpt.pos.Z)
if (actor->spr.pos.Z < cpt.pos.Z)
{
actor->temp_data[0]++;
actor->spr.xvel = 0;
@ -749,9 +749,9 @@ void movecrane(DDukeActor *actor, int crane)
{
if (actor->spr.xvel < 192)
actor->spr.xvel += 8;
actor->spr.ang = getangle(cpt.pos.X - actor->int_pos().X, cpt.pos.Y - actor->int_pos().Y);
actor->spr.ang = getangle(cpt.pos.XY() - actor->spr.pos.XY());
ssp(actor, CLIPMASK0);
if (((actor->int_pos().X - cpt.pos.X) * (actor->int_pos().X - cpt.pos.X) + (actor->int_pos().Y - cpt.pos.Y) * (actor->int_pos().Y - cpt.pos.Y)) < (128 * 128))
if (((actor->spr.pos.X - cpt.pos.X) * (actor->spr.pos.X - cpt.pos.X) + (actor->spr.pos.Y - cpt.pos.Y) * (actor->spr.pos.Y - cpt.pos.Y)) < (8 * 8))
actor->temp_data[0]++;
}

View file

@ -478,11 +478,11 @@ void initcrane(DDukeActor* actj, DDukeActor* act, int CRANEPOLE)
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_ONE_SIDE;
act->spr.picnum += 2;
act->set_int_z(sect->int_ceilingz() + (48 << 8));
act->spr.pos.Z = sect->ceilingz + 48;
act->temp_data[4] = cranes.Reserve(1);
auto& apt = cranes[act->temp_data[4]];
apt.pos = act->int_pos();
apt.pos = act->spr.pos;
apt.poleactor = nullptr;
DukeStatIterator it(STAT_DEFAULT);
@ -497,13 +497,12 @@ void initcrane(DDukeActor* actj, DDukeActor* act, int CRANEPOLE)
actk->spr.xrepeat = 48;
actk->spr.yrepeat = 128;
apt.pole.X = actk->int_pos().X;
apt.pole.Y = actk->int_pos().Y;
apt.pole = actk->spr.pos.XY();
actk->set_int_pos(act->int_pos());
actk->spr.pos = act->spr.pos;
actk->spr.shade = act->spr.shade;
SetActor(actk, actk->int_pos());
SetActor(actk, actk->spr.pos);
break;
}
}

View file

@ -197,8 +197,8 @@ struct player_orig
struct CraneDef
{
vec3_t pos;
vec2_t pole;
DVector3 pos;
DVector2 pole;
TObjPtr<DDukeActor*> poleactor;
};