mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 15:11:04 +00:00
- Exhumed: Migrate to new actor viewzoffset
property.
This commit is contained in:
parent
e3f6b5ff85
commit
13be5f7923
5 changed files with 12 additions and 15 deletions
|
@ -87,7 +87,7 @@ static int osdcmd_spawn(CCmdFuncPtr parm)
|
|||
if (!stricmp(c, "anubis")) BuildAnubis(nullptr, initpos, sectp, inita, false);
|
||||
else if (!stricmp(c, "spider")) BuildSpider(nullptr, initpos, sectp, inita);
|
||||
else if (!stricmp(c, "mummy")) BuildMummy(nullptr, initpos, sectp, inita);
|
||||
else if (!stricmp(c, "fish")) BuildFish(nullptr, initpos.plusZ(PlayerList[nLocalPlayer].eyelevel), sectp, inita);
|
||||
else if (!stricmp(c, "fish")) BuildFish(nullptr, initpos.plusZ(PlayerList[nLocalPlayer].pActor->viewzoffset), sectp, inita);
|
||||
else if (!stricmp(c, "lion")) BuildLion(nullptr, initpos, sectp, inita);
|
||||
else if (!stricmp(c, "lava")) BuildLava(nullptr, initpos, sectp, inita, nNetPlayerCount);
|
||||
else if (!stricmp(c, "rex")) BuildRex(nullptr, initpos, sectp, inita, nNetPlayerCount);
|
||||
|
|
|
@ -400,7 +400,7 @@ void RestartPlayer(int nPlayer)
|
|||
}
|
||||
|
||||
plr->pPlayerGrenade = nullptr;
|
||||
plr->oeyelevel = plr->eyelevel = -55.;
|
||||
pActor->oviewzoffset = pActor->viewzoffset = -55.;
|
||||
dVertPan[nPlayer] = 0;
|
||||
|
||||
nTemperature[nPlayer] = 0;
|
||||
|
@ -504,7 +504,7 @@ void StartDeathSeq(int nPlayer, int nVal)
|
|||
StopFiringWeapon(nPlayer);
|
||||
|
||||
PlayerList[nPlayer].horizon.ohoriz = PlayerList[nPlayer].horizon.horiz = nullAngle;
|
||||
PlayerList[nPlayer].oeyelevel = PlayerList[nPlayer].eyelevel = -55;
|
||||
pActor->oviewzoffset = pActor->viewzoffset = -55;
|
||||
PlayerList[nPlayer].nInvisible = 0;
|
||||
dVertPan[nPlayer] = 15;
|
||||
|
||||
|
@ -908,7 +908,6 @@ void AIPlayer::Tick(RunListEvent* ev)
|
|||
PlayerList[nPlayer].horizon.backup();
|
||||
PlayerList[nPlayer].angle.resetadjustment();
|
||||
PlayerList[nPlayer].horizon.resetadjustment();
|
||||
PlayerList[nPlayer].oeyelevel = PlayerList[nPlayer].eyelevel;
|
||||
|
||||
pPlayerActor->vel.XY() = sPlayerInput[nPlayer].vel;
|
||||
|
||||
|
@ -1170,7 +1169,7 @@ sectdone:
|
|||
|
||||
auto pViewSect = pPlayerActor->sector();
|
||||
|
||||
double EyeZ = PlayerList[nPlayer].eyelevel + pPlayerActor->spr.pos.Z + nQuake[nPlayer];
|
||||
double EyeZ = pPlayerActor->getOffsetZ() + nQuake[nPlayer];
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
@ -2363,8 +2362,8 @@ sectdone:
|
|||
}
|
||||
else
|
||||
{
|
||||
if (PlayerList[nPlayer].eyelevel < -32.5) {
|
||||
PlayerList[nPlayer].eyelevel += ((-32.5 - PlayerList[nPlayer].eyelevel) * 0.5);
|
||||
if (pPlayerActor->viewzoffset < -32.5) {
|
||||
pPlayerActor->viewzoffset += ((-32.5 - pPlayerActor->viewzoffset) * 0.5);
|
||||
}
|
||||
|
||||
loc_1BD2E:
|
||||
|
@ -2382,7 +2381,7 @@ sectdone:
|
|||
{
|
||||
if (PlayerList[nPlayer].nHealth > 0)
|
||||
{
|
||||
PlayerList[nPlayer].eyelevel += (nActionEyeLevel[nAction] - PlayerList[nPlayer].eyelevel) * 0.5;
|
||||
pPlayerActor->viewzoffset += (nActionEyeLevel[nAction] - pPlayerActor->viewzoffset) * 0.5;
|
||||
|
||||
if (bUnderwater)
|
||||
{
|
||||
|
@ -2610,9 +2609,9 @@ sectdone:
|
|||
{
|
||||
PlayerList[nPlayer].nThrust.Zero();
|
||||
|
||||
if (PlayerList[nPlayer].eyelevel >= -11)
|
||||
if (pPlayerActor->viewzoffset >= -11)
|
||||
{
|
||||
PlayerList[nPlayer].eyelevel = -11;
|
||||
pPlayerActor->viewzoffset = -11;
|
||||
dVertPan[nPlayer] = 0;
|
||||
}
|
||||
else
|
||||
|
@ -2620,7 +2619,7 @@ sectdone:
|
|||
if (PlayerList[nPlayer].horizon.horiz.Sgn() > 0)
|
||||
{
|
||||
PlayerList[nPlayer].horizon.settarget(nullAngle);
|
||||
PlayerList[nPlayer].eyelevel -= dVertPan[nPlayer];
|
||||
pPlayerActor->viewzoffset -= dVertPan[nPlayer];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2718,7 +2717,6 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Player& w, Player*
|
|||
("floorspr", w.pPlayerFloorSprite)
|
||||
("save", w.sPlayerSave)
|
||||
("totalvel", w.totalvel)
|
||||
("eyelevel", w.eyelevel)
|
||||
("grenade", w.pPlayerGrenade)
|
||||
|
||||
.EndObject();
|
||||
|
|
|
@ -99,7 +99,6 @@ struct Player
|
|||
PlayerSave sPlayerSave;
|
||||
int ototalvel;
|
||||
int totalvel;
|
||||
double eyelevel, oeyelevel;
|
||||
TObjPtr<DExhumedActor*> pPlayerGrenade;
|
||||
TObjPtr<DExhumedActor*> pPlayerFloorSprite;
|
||||
TObjPtr<DExhumedActor*> pDoppleSprite;
|
||||
|
|
|
@ -676,7 +676,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx)
|
|||
auto pSector =pTSprite->sectp;
|
||||
double nFloorZ = pSector->floorz;
|
||||
|
||||
if (nFloorZ <= PlayerList[nLocalPlayer].eyelevel + initpos.Z) {
|
||||
if (nFloorZ <= PlayerList[nLocalPlayer].pActor->viewzoffset + initpos.Z) {
|
||||
pTSprite->ownerActor = nullptr;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -226,7 +226,7 @@ void DrawView(double interpfrac, bool sceneonly)
|
|||
}
|
||||
else
|
||||
{
|
||||
nCamerapos = pPlayerActor->interpolatedpos(interpfrac).plusZ(interpolatedvalue(PlayerList[nLocalPlayer].oeyelevel, PlayerList[nLocalPlayer].eyelevel, interpfrac));
|
||||
nCamerapos = pPlayerActor->getRenderPos(interpfrac);
|
||||
|
||||
pSector = PlayerList[nLocalPlayer].pPlayerViewSect;
|
||||
updatesector(nCamerapos, &pSector);
|
||||
|
|
Loading…
Reference in a new issue