mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 07:01:09 +00:00
- Always clear object in PlayerAngles::initialize()
rather than expecting the caller to do it.
This commit is contained in:
parent
59acdde9c9
commit
8f9b413d38
5 changed files with 3 additions and 5 deletions
|
@ -112,7 +112,9 @@ struct PlayerAngles
|
|||
// General methods.
|
||||
void initialize(DCoreActor* const actor, const DAngle viewyaw = nullAngle)
|
||||
{
|
||||
if ((pActor = actor)) CameraAngles = PrevLerpAngles = pActor->spr.Angles;
|
||||
*this = {};
|
||||
pActor = actor;
|
||||
CameraAngles = PrevLerpAngles = pActor->spr.Angles;
|
||||
PrevViewAngles.Yaw = ViewAngles.Yaw = viewyaw;
|
||||
}
|
||||
DAngle getPitchWithView()
|
||||
|
|
|
@ -801,7 +801,6 @@ void playerStart(int nPlayer, int bNewLevel)
|
|||
auto actor = actSpawnSprite(pStartZone->sector, pStartZone->pos, 6, 1);
|
||||
assert(actor->hasX());
|
||||
pPlayer->actor = actor;
|
||||
pPlayer->Angles = {};
|
||||
pPlayer->Angles.initialize(pPlayer->actor);
|
||||
DUDEINFO* pDudeInfo = &dudeInfo[kDudePlayer1 + nPlayer - kDudeBase];
|
||||
pPlayer->pDudeInfo = pDudeInfo;
|
||||
|
|
|
@ -603,7 +603,6 @@ void resetpspritevars(int g, const DVector3& startpos, const DAngle startang)
|
|||
act->spr.pal = ps[j].palookup = ud.user_pals[j];
|
||||
|
||||
ps[j].actor = act;
|
||||
ps[j].Angles = {};
|
||||
ps[j].Angles.initialize(ps[j].actor, (currentLevel->levelNumber & 1)? DAngle90 : -DAngle90);
|
||||
ps[j].frag_ps = j;
|
||||
act->SetOwner(act);
|
||||
|
|
|
@ -285,7 +285,6 @@ void RestartPlayer(int nPlayer)
|
|||
pPlayer->pPlayerViewSect = pPlayer->sPlayerSave.pSector;
|
||||
pPlayer->nPlayer = nPlayer;
|
||||
pPlayer->nHealth = 800; // TODO - define
|
||||
pPlayer->Angles = {};
|
||||
pPlayer->Angles.initialize(pPlayerActor);
|
||||
pPlayer->bIsMummified = false;
|
||||
pPlayer->nTorch = 0;
|
||||
|
|
|
@ -2344,7 +2344,6 @@ void InitPlayerSprite(PLAYER* pp, const DVector3& spawnpos, const DAngle startan
|
|||
pp->actor = actor;
|
||||
pp->pnum = pnum;
|
||||
|
||||
pp->Angles = {};
|
||||
pp->Angles.initialize(pp->actor);
|
||||
|
||||
actor->spr.cstat |= (CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
|
|
Loading…
Reference in a new issue