- Duke: Replace DDukeActor lastvy with ovel.Y calls.

This commit is contained in:
Mitchell Richters 2021-12-30 22:55:05 +11:00
parent 8932b2fc1d
commit f9b728d188
5 changed files with 10 additions and 10 deletions

View file

@ -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->ovel.X - actor->spr.pos.X, actor->lastvy - actor->spr.pos.Y);
goalang = getangle(actor->ovel.X - actor->spr.pos.X, actor->ovel.Y - 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

@ -1325,8 +1325,8 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
else SetGameVarID(lVar2, act->ovel.X, sActor, sPlayer);
break;
case ACTOR_HTLASTVY:
if (bSet) act->lastvy = lValue;
else SetGameVarID(lVar2, act->lastvy, sActor, sPlayer);
if (bSet) act->ovel.Y = lValue;
else SetGameVarID(lVar2, act->ovel.Y, sActor, sPlayer);
break;
case ACTOR_HTBPOSX:
if (bSet) act->spr.opos.X = lValue;
@ -1496,14 +1496,14 @@ static bool ifcansee(DDukeActor* actor, int pnum)
{
// search around for target player
// also modifies 'target' x&y if found.
j = furthestcanseepoint(actor, tosee, &actor->ovel.X, &actor->lastvy);
j = furthestcanseepoint(actor, tosee, &actor->ovel.X, &actor->ovel.Y);
}
else
{
// else, they did see it.
// save where we were looking..
actor->ovel.X = tosee->spr.pos.X;
actor->lastvy = tosee->spr.pos.Y;
actor->ovel.Y = tosee->spr.pos.Y;
}
if (j == 1 && (actor->spr.statnum == STAT_ACTOR || actor->spr.statnum == STAT_STANDABLE))
@ -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->ovel.X - 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->ovel.Y - g_ac->spr.pos.Y);
SetGameVarID(i, ang, g_ac, g_p);
break;
}

View file

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

View file

@ -81,7 +81,7 @@ DDukeActor* EGS(sectortype* whatsectp, int s_x, int s_y, int s_z, int s_pn, int8
act->spr.backuploc();
act->ovel.X = 0;
act->lastvy = 0;
act->ovel.Y = 0;
act->timetosleep = 0;
act->actorstayput = nullptr;
@ -153,7 +153,7 @@ bool initspriteforspawn(DDukeActor* act, const std::initializer_list<int> &exclu
act->ceilingz = act->spr.sector()->ceilingz;
act->ovel.X = 0;
act->lastvy = 0;
act->ovel.Y = 0;
act->actorstayput = nullptr;
act->temp_data[0] = act->temp_data[1] = act->temp_data[2] = act->temp_data[3] = act->temp_data[4] = act->temp_data[5] = 0;

View file

@ -38,7 +38,7 @@ public:
short tempang, dispicnum;
short timetosleep;
vec2_t ovel;
int floorz, ceilingz, ovel.X, lastvy, aflags;
int floorz, ceilingz, aflags;
union
{
int saved_ammo;