- Duke: Replace DDukeActor lastvx with ovel.X calls.

This commit is contained in:
Mitchell Richters 2021-12-30 22:54:08 +11:00
parent 0bc26e78ba
commit 8932b2fc1d
6 changed files with 17 additions and 16 deletions

View file

@ -2808,8 +2808,8 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
{
if (statstate)
{
if (!S_CheckSoundPlaying(actor->lastvx))
S_PlayActorSound(actor->lastvx, actor);
if (!S_CheckSoundPlaying(actor->ovel.X))
S_PlayActorSound(actor->ovel.X, actor);
}
if ((!checkstat || !statstate) && (ud.monsters_off == 0 && sc->floorpal == 0 && (sc->floorstat & CSTAT_SECTOR_SKY) && rnd(8)))
{
@ -2825,7 +2825,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
}
if (actor->spr.xvel <= 64 && statstate)
S_StopSound(actor->lastvx, actor);
S_StopSound(actor->ovel.X, actor);
if ((sc->floorz - sc->ceilingz) < (108 << 8))
{
@ -5038,7 +5038,7 @@ void alterang(int ang, DDukeActor* actor, int playernum)
auto Owner = actor->GetOwner();
if (Owner->spr.picnum == TILE_APLAYER)
goalang = getangle(actor->lastvx - actor->spr.pos.X, actor->lastvy - actor->spr.pos.Y);
goalang = getangle(actor->ovel.X - actor->spr.pos.X, actor->lastvy - actor->spr.pos.Y);
else
goalang = getangle(Owner->spr.pos.X - actor->spr.pos.X, Owner->spr.pos.Y - actor->spr.pos.Y);

View file

@ -1014,7 +1014,7 @@ static void movetripbomb(DDukeActor *actor)
DDukeActor* hit;
x = hitasprite(actor, &hit);
actor->lastvx = x;
actor->ovel.X = x;
actor->spr.ang = l;
@ -1081,7 +1081,7 @@ static void movetripbomb(DDukeActor *actor)
actor->spr.pos.Z += (3 << 8);
SetActor(actor, actor->spr.pos);
if (actor->lastvx != x && lTripBombControl & TRIPBOMB_TRIPWIRE)
if (actor->ovel.X != x && lTripBombControl & TRIPBOMB_TRIPWIRE)
{
actor->temp_data[2] = 13;
S_PlayActorSound(LASERTRIP_ARMING, actor);

View file

@ -1321,8 +1321,8 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
else SetGameVarID(lVar2, act->ceilingz, sActor, sPlayer);
break;
case ACTOR_HTLASTVX:
if (bSet) act->lastvx = lValue;
else SetGameVarID(lVar2, act->lastvx, sActor, sPlayer);
if (bSet) act->ovel.X = lValue;
else SetGameVarID(lVar2, act->ovel.X, sActor, sPlayer);
break;
case ACTOR_HTLASTVY:
if (bSet) act->lastvy = lValue;
@ -1496,13 +1496,13 @@ static bool ifcansee(DDukeActor* actor, int pnum)
{
// search around for target player
// also modifies 'target' x&y if found.
j = furthestcanseepoint(actor, tosee, &actor->lastvx, &actor->lastvy);
j = furthestcanseepoint(actor, tosee, &actor->ovel.X, &actor->lastvy);
}
else
{
// else, they did see it.
// save where we were looking..
actor->lastvx = tosee->spr.pos.X;
actor->ovel.X = tosee->spr.pos.X;
actor->lastvy = tosee->spr.pos.Y;
}
@ -3151,7 +3151,7 @@ int ParseState::parse(void)
i = *(insptr++); // ID of def
// g_ac->lastvx and lastvy are last known location of target.
ang = getangle(g_ac->lastvx - g_ac->spr.pos.X, g_ac->lastvy - g_ac->spr.pos.Y);
ang = getangle(g_ac->ovel.X - g_ac->spr.pos.X, g_ac->lastvy - g_ac->spr.pos.Y);
SetGameVarID(i, ang, g_ac, g_p);
break;
}

View file

@ -311,7 +311,7 @@ void DDukeActor::Serialize(FSerializer& arc)
("timetosleep", timetosleep)
("floorz", floorz)
("ceilingz", ceilingz)
("lastvx", lastvx)
("lastvx", ovel.X)
("lastvy", lastvy)
("aflags", aflags)
("saved_ammo", saved_ammo)

View file

@ -80,7 +80,7 @@ DDukeActor* EGS(sectortype* whatsectp, int s_x, int s_y, int s_z, int s_pn, int8
act->spr.lotag = 0;
act->spr.backuploc();
act->lastvx = 0;
act->ovel.X = 0;
act->lastvy = 0;
act->timetosleep = 0;
@ -152,7 +152,7 @@ bool initspriteforspawn(DDukeActor* act, const std::initializer_list<int> &exclu
act->floorz = act->spr.sector()->floorz;
act->ceilingz = act->spr.sector()->ceilingz;
act->lastvx = 0;
act->ovel.X = 0;
act->lastvy = 0;
act->actorstayput = nullptr;
@ -1031,7 +1031,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
else if (actor->spr.sector()->floorpal == 7) j = 456;
else j = 75;
}
actor->lastvx = j;
actor->ovel.X = j;
}
[[fallthrough]];
case SE_30_TWO_WAY_TRAIN:

View file

@ -37,7 +37,8 @@ public:
short attackertype, ang, extra, movflag;
short tempang, dispicnum;
short timetosleep;
int floorz, ceilingz, lastvx, lastvy, aflags;
vec2_t ovel;
int floorz, ceilingz, ovel.X, lastvy, aflags;
union
{
int saved_ammo;