diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 3a7e4ded7..2c263dd8f 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -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); diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 7962f6e1c..0e27dece3 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -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; } diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index 6a35cb8d2..5cb6fdf9b 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -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) diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 3608ae4b7..e5c6e8b28 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -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 &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; diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 298de91e1..6e726b6f0 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -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;