- Duke: Wrap calls that set player_struct::PlayerOldPosition.Z.

This commit is contained in:
Mitchell Richters 2022-11-15 18:38:21 +11:00 committed by Christoph Oelckers
parent 4027f7256d
commit 830480b8b9
3 changed files with 7 additions and 2 deletions

View file

@ -388,7 +388,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break;
case PLAYER_OPOSZ:
if (bSet) ps[iPlayer].PlayerOldPosition.Z = lValue * zmaptoworld;
if (bSet) ps[iPlayer].posoldZset(lValue * zmaptoworld);
else SetGameVarID(lVar2, int(ps[iPlayer].PlayerOldPosition.Z * (1 / zmaptoworld)), sActor, sPlayer);
break;

View file

@ -774,7 +774,7 @@ void player_struct::backuppos(bool noclipping)
posY() = posoldY();
}
PlayerOldPosition.Z = posZget();
posoldZset(posZget());
bobpos = posXY();
opyoff = pyoff;
}

View file

@ -413,6 +413,11 @@ struct player_struct
{
return PlayerOldPosition.XY();
}
void posoldZset(const double val)
{
PlayerOldPosition.Z = val;
}
};
struct Cycler