mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- Exhumed: Manual sweep for last replacements of player index for pointer.
This commit is contained in:
parent
69347e80e7
commit
eacc882096
5 changed files with 19 additions and 17 deletions
|
@ -1856,30 +1856,30 @@ void runlist_DamageEnemy(DExhumedActor* pActor, DExhumedActor* pActor2, int nDam
|
|||
return;
|
||||
}
|
||||
|
||||
int nPlayer = GetPlayerFromActor(pActor2);
|
||||
const auto pPlayer = getPlayer(GetPlayerFromActor(pActor2));
|
||||
// Due to the horrible setup we can award the kill to the player only here. Yuck!
|
||||
Level.kills.player[nPlayer]++;
|
||||
Level.kills.player[pPlayer->pnum]++;
|
||||
|
||||
getPlayer(nPlayer)->nTauntTimer--;
|
||||
pPlayer->nTauntTimer--;
|
||||
|
||||
if (getPlayer(nPlayer)->nTauntTimer <= 0)
|
||||
if (pPlayer->nTauntTimer <= 0)
|
||||
{
|
||||
// Do a taunt
|
||||
auto pPlayerActor = getPlayer(nPlayer)->GetActor();
|
||||
auto pPlayerActor = pPlayer->GetActor();
|
||||
auto pSector = pPlayerActor->sector();
|
||||
|
||||
if (!(pSector->Flag & kSectUnderwater))
|
||||
{
|
||||
int ebx = 0x4000;
|
||||
|
||||
if (nPlayer == nLocalPlayer) {
|
||||
if (pPlayer->pnum == nLocalPlayer) {
|
||||
ebx = 0x6000;
|
||||
}
|
||||
|
||||
D3PlayFX(StaticSound[kSoundTauntStart + (RandomSize(3) % 5)], getPlayer(nPlayer)->pDoppleSprite, ebx);
|
||||
D3PlayFX(StaticSound[kSoundTauntStart + (RandomSize(3) % 5)], pPlayer->pDoppleSprite, ebx);
|
||||
}
|
||||
|
||||
getPlayer(nPlayer)->nTauntTimer = RandomSize(3) + 3;
|
||||
pPlayer->nTauntTimer = RandomSize(3) + 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -508,7 +508,7 @@ void seq_PlotSequence(const int nSprite, const FName seqFile, const int16_t seqI
|
|||
const auto pSector = pTSprite->sectp;
|
||||
const double nFloorZ = pSector->floorz;
|
||||
|
||||
if (nFloorZ <= getPlayer(nLocalPlayer)->GetActor()->viewzoffset + getPlayer(nLocalPlayer)->GetActor()->spr.pos.Z)
|
||||
if (nFloorZ <= getPlayer(nLocalPlayer)->GetActor()->getOffsetZ())
|
||||
{
|
||||
pTSprite->ownerActor = nullptr;
|
||||
}
|
||||
|
|
|
@ -702,7 +702,9 @@ void UpdateCreepySounds()
|
|||
nCreepyTimer--;
|
||||
if (nCreepyTimer <= 0)
|
||||
{
|
||||
if (Level.kills.got < Level.kills.max && !(getPlayer(nLocalPlayer)->pPlayerViewSect->Flag & 0x2000))
|
||||
const auto pPlayer = getPlayer(nLocalPlayer);
|
||||
|
||||
if (Level.kills.got < Level.kills.max && !(pPlayer->pPlayerViewSect->Flag & 0x2000))
|
||||
{
|
||||
const auto creepySeq = getSequence("creepy");
|
||||
const auto seqFrameSound = creepySeq->frames[totalmoves % creepySeq->frames.Size()].sound;
|
||||
|
@ -716,7 +718,7 @@ void UpdateCreepySounds()
|
|||
if (totalmoves & 2)
|
||||
adder.Y = -adder.Y;
|
||||
|
||||
auto sp = getPlayer(nLocalPlayer)->GetActor()->spr.pos + adder;
|
||||
auto sp = pPlayer->GetActor()->spr.pos + adder;
|
||||
creepy = GetSoundPos(sp);
|
||||
|
||||
auto soundid = FSoundID::fromInt((seqFrameSound & 0x1ff) + 1);
|
||||
|
|
|
@ -546,9 +546,9 @@ void AISWPressSector::Use(RunListEvent* ev)
|
|||
|
||||
int nChannel = SwitchData[nSwitch].nChannel;
|
||||
int nLink = SwitchData[nSwitch].nLink;
|
||||
int nPlayer = ev->nParam;
|
||||
const auto pPlayer = getPlayer(ev->nParam);
|
||||
|
||||
if ((getPlayer(nPlayer)->keys & SwitchData[nSwitch].nKeyMask) == SwitchData[nSwitch].nKeyMask)
|
||||
if ((pPlayer->keys & SwitchData[nSwitch].nKeyMask) == SwitchData[nSwitch].nKeyMask)
|
||||
{
|
||||
runlist_ChangeChannel(nChannel, LinkMap[nLink].v[sRunChannels[nChannel].c]);
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ void AISWPressSector::Use(RunListEvent* ev)
|
|||
{
|
||||
if (SwitchData[nSwitch].nKeyMask)
|
||||
{
|
||||
PlayFXAtXYZ(StaticSound[nSwitchSound], getPlayer(nPlayer)->GetActor()->spr.pos, CHANF_LISTENERZ);
|
||||
PlayFXAtXYZ(StaticSound[nSwitchSound], pPlayer->GetActor()->spr.pos, CHANF_LISTENERZ);
|
||||
|
||||
StatusMessage(300, GStrings("TXT_EX_NEEDKEY"));
|
||||
}
|
||||
|
|
|
@ -107,11 +107,11 @@ void DrawView(double interpfrac, bool sceneonly)
|
|||
{
|
||||
nCamerapos = pPlayerActor->getRenderPos(interpfrac);
|
||||
|
||||
pSector = getPlayer(nLocalPlayer)->pPlayerViewSect;
|
||||
pSector = pPlayer->pPlayerViewSect;
|
||||
updatesector(nCamerapos, &pSector);
|
||||
if (pSector == nullptr) pSector = getPlayer(nLocalPlayer)->pPlayerViewSect;
|
||||
if (pSector == nullptr) pSector = pPlayer->pPlayerViewSect;
|
||||
|
||||
nCameraangles = getPlayer(nLocalPlayer)->Angles.getRenderAngles(interpfrac);
|
||||
nCameraangles = pPlayer->Angles.getRenderAngles(interpfrac);
|
||||
|
||||
if (!bCamera)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue