- floatified exit position.

This commit is contained in:
Christoph Oelckers 2022-09-12 21:28:57 +02:00
parent 1a64d18349
commit 2de1aea4a6
6 changed files with 11 additions and 13 deletions

View file

@ -296,13 +296,13 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break;
case PLAYER_EXITX:
if (bSet) ps[iPlayer].exit.X = lValue;
else SetGameVarID(lVar2, ps[iPlayer].exit.X, sActor, sPlayer);
if (bSet) ps[iPlayer].Exit.X = lValue * maptoworld;
else SetGameVarID(lVar2, ps[iPlayer].Exit.X / maptoworld, sActor, sPlayer);
break;
case PLAYER_EXITY:
if (bSet) ps[iPlayer].exit.Y = lValue;
else SetGameVarID(lVar2, ps[iPlayer].exit.Y, sActor, sPlayer);
if (bSet) ps[iPlayer].Exit.Y = lValue * maptoworld;
else SetGameVarID(lVar2, ps[iPlayer].Exit.Y / maptoworld, sActor, sPlayer);
break;
case PLAYER_LOOGIEX:

View file

@ -746,8 +746,7 @@ void prelevel_common(int g)
if (sectp->lotag == -1)
{
ps[0].exit.X = sectp->firstWall()->wall_int_pos().X;
ps[0].exit.Y = sectp->firstWall()->wall_int_pos().Y;
ps[0].Exit = sectp->firstWall()->pos;
continue;
}
}

View file

@ -282,8 +282,7 @@ void prelevel_d(int g, TArray<DDukeActor*>& actors)
if (ac->spr.lotag == -1 && (ac->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL))
{
ps[0].exit.X = ac->int_pos().X;
ps[0].exit.Y = ac->int_pos().Y;
ps[0].Exit = ac->spr.pos.XY();
}
else
premapcontroller(ac);

View file

@ -535,8 +535,7 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
if (ac->spr.lotag == -1 && (ac->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL))
{
ps[0].exit.X = ac->int_pos().X;
ps[0].exit.Y = ac->int_pos().Y;
ps[0].Exit = ac->spr.pos.XY();
}
else switch (ac->spr.picnum)
{

View file

@ -114,8 +114,8 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
("pals", w.pals)
("fricx", w.fric.X)
("fricy", w.fric.Y)
("exitx", w.exit.X)
("exity", w.exit.Y)
("exitx", w.Exit.X)
("exity", w.Exit.Y)
("numloogs", w.numloogs)
("loogcnt", w.loogcnt)
.Array("loogie", w.loogie, w.numloogs)

View file

@ -206,6 +206,7 @@ struct player_struct
DVector3 pos, opos;
DVector2 bobpos;
DVector2 fric;
DVector2 Exit;
// player's horizon and angle structs.
PlayerHorizon horizon;
@ -219,7 +220,7 @@ struct player_struct
PalEntry pals;
// this was a global variable originally.
vec2_t exit, loogie[64];
vec2_t loogie[64];
// weapon drawer variables and their interpolation counterparts.
int weapon_sway;