mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- store an actual actor pointer in PLAYER.
# Conflicts: # source/games/blood/src/player.cpp
This commit is contained in:
parent
812b18e49a
commit
fb95f0fff7
22 changed files with 121 additions and 129 deletions
|
@ -1537,7 +1537,7 @@ void aiThinkTarget(DBloodActor* actor)
|
|||
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
||||
{
|
||||
PLAYER* pPlayer = &gPlayer[p];
|
||||
if (actor->GetOwner() == pPlayer->actor() || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
|
||||
if (actor->GetOwner() == pPlayer->actor || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
|
||||
continue;
|
||||
int x = pPlayer->pSprite->x;
|
||||
int y = pPlayer->pSprite->y;
|
||||
|
@ -1554,7 +1554,7 @@ void aiThinkTarget(DBloodActor* actor)
|
|||
int nDeltaAngle = ((getangle(dx, dy) + 1024 - pSprite->ang) & 2047) - 1024;
|
||||
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
|
||||
{
|
||||
aiSetTarget(actor, pPlayer->actor());
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
aiActivateDude(actor);
|
||||
return;
|
||||
}
|
||||
|
@ -1585,7 +1585,7 @@ void aiLookForTarget(DBloodActor* actor)
|
|||
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
||||
{
|
||||
PLAYER* pPlayer = &gPlayer[p];
|
||||
if (actor->GetOwner() == pPlayer->actor() || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
|
||||
if (actor->GetOwner() == pPlayer->actor || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
|
||||
continue;
|
||||
int x = pPlayer->pSprite->x;
|
||||
int y = pPlayer->pSprite->y;
|
||||
|
@ -1601,7 +1601,7 @@ void aiLookForTarget(DBloodActor* actor)
|
|||
int nDeltaAngle = ((getangle(dx, dy) + 1024 - pSprite->ang) & 2047) - 1024;
|
||||
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
|
||||
{
|
||||
aiSetTarget(actor, pPlayer->actor());
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
aiActivateDude(actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ static void batThinkTarget(DBloodActor* actor)
|
|||
int nDeltaAngle = ((getangle(dx, dy) + 1024 - pSprite->ang) & 2047) - 1024;
|
||||
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
|
||||
{
|
||||
aiSetTarget(actor, pPlayer->actor());
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
aiActivateDude(actor);
|
||||
}
|
||||
else if (nDist < pDudeInfo->hearDist)
|
||||
|
|
|
@ -130,7 +130,7 @@ static void eelThinkTarget(DBloodActor* actor)
|
|||
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
|
||||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
aiSetTarget(actor, pPlayer->actor());
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
aiActivateDude(actor);
|
||||
}
|
||||
else if (nDist < pDudeInfo->hearDist)
|
||||
|
|
|
@ -289,7 +289,7 @@ static void cerberusThinkTarget(DBloodActor* actor)
|
|||
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
|
||||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
aiSetTarget(actor, pPlayer->actor());
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
aiActivateDude(actor);
|
||||
}
|
||||
else if (nDist < pDudeInfo->hearDist)
|
||||
|
|
|
@ -248,7 +248,7 @@ static void gargThinkTarget(DBloodActor* actor)
|
|||
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
|
||||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
aiSetTarget(actor, pPlayer->actor());
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
aiActivateDude(actor);
|
||||
}
|
||||
else if (nDist < pDudeInfo->hearDist)
|
||||
|
|
|
@ -225,7 +225,7 @@ static void ghostThinkTarget(DBloodActor* actor)
|
|||
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
|
||||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
aiSetTarget(actor, pPlayer->actor());
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
aiActivateDude(actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ static void sub_725A4(DBloodActor* actor)
|
|||
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
|
||||
{
|
||||
pDudeExtraE->thinkTime = 0;
|
||||
aiSetTarget(actor, pPlayer->actor());
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
aiActivateDude(actor);
|
||||
}
|
||||
else if (nDist < pDudeInfo->hearDist)
|
||||
|
|
|
@ -222,7 +222,7 @@ static void myThinkTarget(DBloodActor* actor)
|
|||
{
|
||||
PLAYER* pPlayer = &gPlayer[p];
|
||||
auto owneractor = actor->GetOwner();
|
||||
if (owneractor == nullptr || owneractor == pPlayer->actor() || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
|
||||
if (owneractor == nullptr || owneractor == pPlayer->actor || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
|
||||
continue;
|
||||
int x = pPlayer->pSprite->x;
|
||||
int y = pPlayer->pSprite->y;
|
||||
|
@ -238,7 +238,7 @@ static void myThinkTarget(DBloodActor* actor)
|
|||
int nDeltaAngle = ((getangle(dx, dy) + 1024 - pSprite->ang) & 2047) - 1024;
|
||||
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
|
||||
{
|
||||
aiSetTarget(actor, pPlayer->actor());
|
||||
aiSetTarget(actor, pPlayer->actor);
|
||||
aiActivateDude(actor);
|
||||
}
|
||||
else if (nDist < pDudeInfo->hearDist)
|
||||
|
|
|
@ -806,7 +806,7 @@ void viewProcessSprites(spritetype* tsprite, int& spritesortcnt, int32_t cX, int
|
|||
case kMissileFlareRegular:
|
||||
case kMissileFlareAlt:
|
||||
if (pTSprite->statnum == kStatFlare) {
|
||||
if (owneractor->GetTarget() == gView->actor())
|
||||
if (owneractor->GetTarget() == gView->actor)
|
||||
{
|
||||
pTSprite->xrepeat = 0;
|
||||
break;
|
||||
|
|
|
@ -107,7 +107,7 @@ void StartLevel(MapRecord* level, bool newgame)
|
|||
for (int i = connecthead; i >= 0; i = connectpoint2[i])
|
||||
{
|
||||
memcpy(&gPlayerTemp[i], &gPlayer[i], sizeof(PLAYER));
|
||||
gHealthTemp[i] = gPlayer[i].actor()->x().health;
|
||||
gHealthTemp[i] = gPlayer[i].actor->x().health;
|
||||
}
|
||||
}
|
||||
memset(xsprite, 0, sizeof(xsprite));
|
||||
|
|
|
@ -327,12 +327,6 @@ inline void GetActorExtents(DBloodActor* actor, int* top, int* bottom)
|
|||
GetSpriteExtents(&actor->s(), top, bottom);
|
||||
}
|
||||
|
||||
inline DBloodActor* PLAYER::actor()
|
||||
{
|
||||
return &bloodActors[pSprite->index];
|
||||
}
|
||||
|
||||
|
||||
inline DBloodActor* getUpperLink(int sect)
|
||||
{
|
||||
return gUpperLink[sect];
|
||||
|
|
|
@ -381,7 +381,7 @@ void FinishHim(DBloodActor* actor, int) // 13
|
|||
{
|
||||
if (!actor) return;
|
||||
spritetype* pSprite = &actor->s();
|
||||
if (actor->IsPlayerActor() && playerSeqPlaying(&gPlayer[pSprite->type - kDudePlayer1], 16) && actor == gMe->actor())
|
||||
if (actor->IsPlayerActor() && playerSeqPlaying(&gPlayer[pSprite->type - kDudePlayer1], 16) && actor == gMe->actor)
|
||||
sndStartSample(3313, -1, 1, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -459,14 +459,14 @@ void evSend(DBloodActor* actor, int nIndex, int nType, int rxId, COMMAND_ID comm
|
|||
if (playerRXRngIsFine(rxId))
|
||||
{
|
||||
if ((pPlayer = getPlayerById((rxId - kChannelPlayer7) + kMaxPlayers)) != nullptr)
|
||||
trMessageSprite(pPlayer->actor(), event);
|
||||
trMessageSprite(pPlayer->actor, event);
|
||||
}
|
||||
else if (rxId == kChannelAllPlayers)
|
||||
{
|
||||
for (int i = 0; i < kMaxPlayers; i++)
|
||||
{
|
||||
if ((pPlayer = getPlayerById(i)) != nullptr)
|
||||
trMessageSprite(pPlayer->actor(), event);
|
||||
trMessageSprite(pPlayer->actor, event);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -304,27 +304,27 @@ const char* GameInterface::GenericCheat(int player, int cheat)
|
|||
SetToys(true);
|
||||
break;
|
||||
case kCheatKevorkian:
|
||||
actDamageSprite(gMe->actor(), gMe->actor(), kDamageBullet, 8000);
|
||||
actDamageSprite(gMe->actor, gMe->actor, kDamageBullet, 8000);
|
||||
return GStrings("TXTB_KEVORKIAN");
|
||||
|
||||
case kCheatMcGee:
|
||||
{
|
||||
if (!gMe->pXSprite->burnTime)
|
||||
evPostActor(gMe->actor(), 0, kCallbackFXFlameLick);
|
||||
actBurnSprite(gMe->actor(), gMe->actor(), 2400);
|
||||
evPostActor(gMe->actor, 0, kCallbackFXFlameLick);
|
||||
actBurnSprite(gMe->actor, gMe->actor, 2400);
|
||||
return GStrings("TXTB_FIRED");
|
||||
}
|
||||
case kCheatEdmark:
|
||||
actDamageSprite(gMe->actor(), gMe->actor(), kDamageExplode, 8000);
|
||||
actDamageSprite(gMe->actor, gMe->actor, kDamageExplode, 8000);
|
||||
return GStrings("TXTB_THEDAYS");
|
||||
|
||||
case kCheatKrueger:
|
||||
{
|
||||
actHealDude(gMe->actor(), 200, 200);
|
||||
actHealDude(gMe->actor, 200, 200);
|
||||
gMe->armor[1] = VanillaMode() ? 200 : 3200;
|
||||
if (!gMe->pXSprite->burnTime)
|
||||
evPostActor(gMe->actor(), 0, kCallbackFXFlameLick);
|
||||
actBurnSprite(gMe->actor(), gMe->actor(), 2400);
|
||||
evPostActor(gMe->actor, 0, kCallbackFXFlameLick);
|
||||
actBurnSprite(gMe->actor, gMe->actor, 2400);
|
||||
return GStrings("TXTB_RETARD");
|
||||
}
|
||||
case kCheatSterno:
|
||||
|
@ -334,7 +334,7 @@ const char* GameInterface::GenericCheat(int player, int cheat)
|
|||
gMe->flickerEffect = 360;
|
||||
break;
|
||||
case kCheatSpork:
|
||||
actHealDude(gMe->actor(), 200, 200);
|
||||
actHealDude(gMe->actor, 200, 200);
|
||||
break;
|
||||
case kCheatClarice:
|
||||
for (int i = 0; i < 3; i++)
|
||||
|
@ -383,7 +383,7 @@ const char* GameInterface::GenericCheat(int player, int cheat)
|
|||
SetWooMode(true);
|
||||
break;
|
||||
case kCheatCousteau:
|
||||
actHealDude(gMe->actor(), 200, 200);
|
||||
actHealDude(gMe->actor, 200, 200);
|
||||
gMe->packSlots[1].curAmount = 100;
|
||||
if (!VanillaMode())
|
||||
gMe->pwUpTime[kPwUpDivingSuit] = gPowerUpInfo[kPwUpDivingSuit].bonusTime;
|
||||
|
@ -507,7 +507,7 @@ static void cmd_Give(int player, uint8_t **stream, bool skip)
|
|||
break;
|
||||
|
||||
case GIVE_HEALTH:
|
||||
actHealDude(gMe->actor(), 200, 200);
|
||||
actHealDude(gMe->actor, 200, 200);
|
||||
bPlayerCheated = true;
|
||||
break;
|
||||
|
||||
|
|
|
@ -1270,10 +1270,10 @@ void nnExtProcessSuperSprites()
|
|||
for (int a = connecthead; a >= 0; a = connectpoint2[a])
|
||||
{
|
||||
PLAYER* pPlayer = &gPlayer[a];
|
||||
if (!pPlayer || !pPlayer->actor()->hasX() || pPlayer->pXSprite->health <= 0)
|
||||
if (!pPlayer || !pPlayer->actor->hasX() || pPlayer->pXSprite->health <= 0)
|
||||
continue;
|
||||
|
||||
if (pPlayer->pXSprite->health > 0 && CheckProximity(gPlayer->actor(), x, y, z, sectnum, okDist))
|
||||
if (pPlayer->pXSprite->health > 0 && CheckProximity(gPlayer->actor, x, y, z, sectnum, okDist))
|
||||
{
|
||||
trTriggerSprite(gProxySpritesList[i], kCmdSpriteProximity);
|
||||
break;
|
||||
|
@ -1315,7 +1315,7 @@ void nnExtProcessSuperSprites()
|
|||
for (int a = connecthead; a >= 0; a = connectpoint2[a])
|
||||
{
|
||||
PLAYER* pPlayer = &gPlayer[a];
|
||||
if (!pPlayer || !pPlayer->actor()->hasX() || pPlayer->pXSprite->health <= 0)
|
||||
if (!pPlayer || !pPlayer->actor->hasX() || pPlayer->pXSprite->health <= 0)
|
||||
continue;
|
||||
|
||||
spritetype* pPlaySprite = pPlayer->pSprite;
|
||||
|
@ -1334,9 +1334,9 @@ void nnExtProcessSuperSprites()
|
|||
if (!vector)
|
||||
pSightSpr->cstat |= CSTAT_SPRITE_BLOCK_HITSCAN;
|
||||
|
||||
HitScan(pPlayer->actor(), pPlayer->zWeapon, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, CLIPMASK0 | CLIPMASK1, 0);
|
||||
HitScan(pPlayer->actor, pPlayer->zWeapon, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, CLIPMASK0 | CLIPMASK1, 0);
|
||||
|
||||
//VectorScan(pPlayer->actor(), 0, pPlayer->zWeapon, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, 0, 1);
|
||||
//VectorScan(pPlayer->actor, 0, pPlayer->zWeapon, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, 0, 1);
|
||||
|
||||
if (!vector)
|
||||
pSightSpr->cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN;
|
||||
|
@ -1415,7 +1415,7 @@ void nnExtProcessSuperSprites()
|
|||
for (int a = connecthead; a != -1; a = connectpoint2[a])
|
||||
{
|
||||
pPlayer = &gPlayer[a];
|
||||
auto pact = pPlayer->actor();
|
||||
auto pact = pPlayer->actor;
|
||||
if (pact->hit.hit.type == kHitSprite && pact->hit.hit.index == nDebris)
|
||||
{
|
||||
int nSpeed = approxDist(pact->xvel, pact->yvel);
|
||||
|
@ -2139,7 +2139,7 @@ void trPlayerCtrlLink(DBloodActor* sourceactor, PLAYER* pPlayer, bool checkCondi
|
|||
{
|
||||
auto pXSource = &sourceactor->x();
|
||||
// save player's sprite index to let the tracking condition know it after savegame loading...
|
||||
pXSource->sysData1 = pPlayer->nSprite;
|
||||
sourceactor->prevmarker = pPlayer->actor;
|
||||
|
||||
pPlayer->pXSprite->txID = pXSource->txID;
|
||||
pPlayer->pXSprite->command = kCmdToggle;
|
||||
|
@ -2181,7 +2181,7 @@ void trPlayerCtrlLink(DBloodActor* sourceactor, PLAYER* pPlayer, bool checkCondi
|
|||
for (unsigned k = 0; k < pCond->length; k++)
|
||||
{
|
||||
if (pCond->obj[k].type != OBJ_SPRITE || pCond->obj[k].actor != sourceactor) continue;
|
||||
pCond->obj[k].actor = pPlayer->actor();
|
||||
pCond->obj[k].actor = pPlayer->actor;
|
||||
pCond->obj[k].index_ = 0;
|
||||
pCond->obj[k].cmd = (uint8_t)pPlayer->pXSprite->command;
|
||||
break;
|
||||
|
@ -4295,7 +4295,7 @@ bool condCheckPlayer(DBloodActor* aCond, int cmpOp, bool PUSH)
|
|||
|
||||
for (int i = 0; i < kMaxPlayers; i++)
|
||||
{
|
||||
if (objActor != gPlayer[i].actor()) continue;
|
||||
if (objActor != gPlayer[i].actor) continue;
|
||||
pPlayer = &gPlayer[i];
|
||||
break;
|
||||
}
|
||||
|
@ -4308,8 +4308,8 @@ bool condCheckPlayer(DBloodActor* aCond, int cmpOp, bool PUSH)
|
|||
|
||||
switch (cond) {
|
||||
case 0: // check if this player is connected
|
||||
if (!condCmp(pPlayer->nPlayer + 1, arg1, arg2, cmpOp) || pPlayer->actor() == nullptr) return false;
|
||||
else if (PUSH) condPush(aCond, OBJ_SPRITE, 0, pPlayer->actor());
|
||||
if (!condCmp(pPlayer->nPlayer + 1, arg1, arg2, cmpOp) || pPlayer->actor == nullptr) return false;
|
||||
else if (PUSH) condPush(aCond, OBJ_SPRITE, 0, pPlayer->actor);
|
||||
return (pPlayer->nPlayer >= 0);
|
||||
case 1: return condCmp((gGameOptions.nGameType != 3) ? 0 : pPlayer->teamId + 1, arg1, arg2, cmpOp); // compare team
|
||||
case 2: return (arg1 > 0 && arg1 < 8 && pPlayer->hasKey[arg1 - 1]);
|
||||
|
@ -4351,8 +4351,8 @@ bool condCheckPlayer(DBloodActor* aCond, int cmpOp, bool PUSH)
|
|||
case 14: return condCmp(pPlayer->posture + 1, arg1, arg2, cmpOp);
|
||||
case 46: return condCmp(pPlayer->sceneQav, arg1, arg2, cmpOp);
|
||||
case 47: return (pPlayer->godMode || powerupCheck(pPlayer, kPwUpDeathMask));
|
||||
case 48: return isShrinked(pPlayer->actor());
|
||||
case 49: return isGrown(pPlayer->actor());
|
||||
case 48: return isShrinked(pPlayer->actor);
|
||||
case 49: return isGrown(pPlayer->actor);
|
||||
}
|
||||
|
||||
condError(aCond, "Unexpected condition #%d!", cond);
|
||||
|
@ -5740,7 +5740,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT event)
|
|||
{
|
||||
PLAYER* pPlayer = getPlayerById(pXSprite->data1);
|
||||
if (pPlayer != NULL)
|
||||
useSpriteDamager(actor, OBJ_SPRITE, 0, pPlayer->actor());
|
||||
useSpriteDamager(actor, OBJ_SPRITE, 0, pPlayer->actor);
|
||||
}
|
||||
|
||||
if (pXSprite->busyTime > 0)
|
||||
|
@ -5759,7 +5759,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT event)
|
|||
|
||||
PLAYER* pPlayer = getPlayerById(pXSprite->data1);
|
||||
if (pPlayer != NULL && SetSpriteState(actor, pXSprite->state ^ 1) == 1)
|
||||
useTeleportTarget(actor, pPlayer->actor());
|
||||
useTeleportTarget(actor, pPlayer->actor);
|
||||
return true;
|
||||
}
|
||||
[[fallthrough]];
|
||||
|
@ -5956,7 +5956,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT event)
|
|||
|
||||
switch (cmd) {
|
||||
case 36:
|
||||
actHealDude(pPlayer->actor(), ((pXSprite->data2 > 0) ? ClipHigh(pXSprite->data2, 200) : getDudeInfo(pPlayer->pSprite->type)->startHealth), 200);
|
||||
actHealDude(pPlayer->actor, ((pXSprite->data2 > 0) ? ClipHigh(pXSprite->data2, 200) : getDudeInfo(pPlayer->pSprite->type)->startHealth), 200);
|
||||
pPlayer->curWeapon = kWeapPitchFork;
|
||||
break;
|
||||
}
|
||||
|
@ -8405,10 +8405,10 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
for (i = connecthead; i != -1; i = connectpoint2[i])
|
||||
{
|
||||
pPlayer = &gPlayer[i];
|
||||
if (!pPlayer->actor()->hasX()) continue;
|
||||
if (!pPlayer->actor->hasX()) continue;
|
||||
|
||||
spritetype* pSpr = pPlayer->pSprite;
|
||||
XSPRITE* pXSpr = &pPlayer->actor()->x();
|
||||
XSPRITE* pXSpr = &pPlayer->actor->x();
|
||||
if (pXSpr->health <= 0)
|
||||
continue;
|
||||
|
||||
|
@ -8424,7 +8424,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
if (nDist <= seeDist)
|
||||
{
|
||||
eyeAboveZ = (pDudeInfo->eyeHeight * pSprite->yrepeat) << 2;
|
||||
if (nDist < seeDist >> 3) GetActorExtents(pPlayer->actor(), &z, &j); //use ztop of the target sprite
|
||||
if (nDist < seeDist >> 3) GetActorExtents(pPlayer->actor, &z, &j); //use ztop of the target sprite
|
||||
if (!cansee(x, y, z, pSpr->sectnum, pSprite->x, pSprite->y, pSprite->z - eyeAboveZ, pSprite->sectnum))
|
||||
continue;
|
||||
}
|
||||
|
@ -8432,11 +8432,11 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
continue;
|
||||
|
||||
bool invisible = (powerupCheck(pPlayer, kPwUpShadowCloak) > 0);
|
||||
if (spritesTouching(actor, pPlayer->actor()) || spritesTouching(pPlayer->actor(), actor))
|
||||
if (spritesTouching(actor, pPlayer->actor) || spritesTouching(pPlayer->actor, actor))
|
||||
{
|
||||
DPrintf(DMSG_SPAMMY, "Patrol dude #%d spot the Player #%d via touch.", actor->GetIndex(), pPlayer->nPlayer + 1);
|
||||
if (invisible) pPlayer->pwUpTime[kPwUpShadowCloak] = 0;
|
||||
newtarget = pPlayer->actor();
|
||||
newtarget = pPlayer->actor;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -8490,7 +8490,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
BloodSectIterator it(searchsect);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->GetOwner() == pPlayer->actor())
|
||||
if (act->GetOwner() == pPlayer->actor)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
|
@ -8506,7 +8506,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
|
||||
if (invisible && hearChance >= kMaxPatrolSpotValue >> 2)
|
||||
{
|
||||
newtarget = pPlayer->actor();
|
||||
newtarget = pPlayer->actor;
|
||||
pPlayer->pwUpTime[kPwUpShadowCloak] = 0;
|
||||
invisible = false;
|
||||
break;
|
||||
|
@ -8552,7 +8552,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
|
||||
if (hearDist)
|
||||
{
|
||||
auto act = pPlayer->actor();
|
||||
auto act = pPlayer->actor;
|
||||
itCanHear = (!deaf && (nDist < hearDist || hearChance > 0));
|
||||
if (itCanHear && nDist < feelDist && (act->xvel || act->yvel || act->zvel))
|
||||
hearChance += ClipLow(mulscale8(1, ClipLow(((feelDist - nDist) + (abs(act->xvel) + abs(act->yvel) + abs(act->zvel))) >> 6, 0)), 0);
|
||||
|
@ -8666,7 +8666,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
pXSprite->data3 = ClipRange(pXSprite->data3 + hearChance, -kMaxPatrolSpotValue, kMaxPatrolSpotValue);
|
||||
if (!stealth)
|
||||
{
|
||||
newtarget = pPlayer->actor();
|
||||
newtarget = pPlayer->actor;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -8678,7 +8678,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
pXSprite->data3 = ClipRange(pXSprite->data3 + seeChance, -kMaxPatrolSpotValue, kMaxPatrolSpotValue);
|
||||
if (!stealth)
|
||||
{
|
||||
newtarget = pPlayer->actor();
|
||||
newtarget = pPlayer->actor;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -8688,7 +8688,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
|
||||
if ((pXSprite->data3 = ClipRange(pXSprite->data3, 0, kMaxPatrolSpotValue)) == kMaxPatrolSpotValue)
|
||||
{
|
||||
newtarget = pPlayer->actor();
|
||||
newtarget = pPlayer->actor;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -254,12 +254,12 @@ char powerupActivate(PLAYER *pPlayer, int nPowerUp)
|
|||
break;
|
||||
case kItemShroomShrink:
|
||||
if (!gModernMap) break;
|
||||
else if (isGrown(pPlayer->actor())) playerDeactivateShrooms(pPlayer);
|
||||
else if (isGrown(pPlayer->actor)) playerDeactivateShrooms(pPlayer);
|
||||
else playerSizeShrink(pPlayer, 2);
|
||||
break;
|
||||
case kItemShroomGrow:
|
||||
if (!gModernMap) break;
|
||||
else if (isShrinked(pPlayer->actor())) playerDeactivateShrooms(pPlayer);
|
||||
else if (isShrinked(pPlayer->actor)) playerDeactivateShrooms(pPlayer);
|
||||
else {
|
||||
playerSizeGrow(pPlayer, 2);
|
||||
if (powerupCheck(&gPlayer[pPlayer->pSprite->type - kDudePlayer1], kPwUpShadowCloak) > 0) {
|
||||
|
@ -267,8 +267,8 @@ char powerupActivate(PLAYER *pPlayer, int nPowerUp)
|
|||
pPlayer->pwUpTime[kPwUpShadowCloak] = 0;
|
||||
}
|
||||
|
||||
if (ceilIsTooLow(pPlayer->actor()))
|
||||
actDamageSprite(pPlayer->actor(), pPlayer->actor(), kDamageExplode, 65535);
|
||||
if (ceilIsTooLow(pPlayer->actor))
|
||||
actDamageSprite(pPlayer->actor, pPlayer->actor, kDamageExplode, 65535);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
@ -315,8 +315,8 @@ void powerupDeactivate(PLAYER *pPlayer, int nPowerUp)
|
|||
case kItemShroomShrink:
|
||||
if (gModernMap) {
|
||||
playerSizeReset(pPlayer);
|
||||
if (ceilIsTooLow(pPlayer->actor()))
|
||||
actDamageSprite(pPlayer->actor(), pPlayer->actor(), kDamageExplode, 65535);
|
||||
if (ceilIsTooLow(pPlayer->actor))
|
||||
actDamageSprite(pPlayer->actor, pPlayer->actor, kDamageExplode, 65535);
|
||||
}
|
||||
break;
|
||||
case kItemShroomGrow:
|
||||
|
@ -486,7 +486,7 @@ void packUseItem(PLAYER *pPlayer, int nPack)
|
|||
if (health < 100)
|
||||
{
|
||||
int heal = ClipHigh(100-health, pPlayer->packSlots[0].curAmount);
|
||||
actHealDude(pPlayer->actor(), heal, 100);
|
||||
actHealDude(pPlayer->actor, heal, 100);
|
||||
pPlayer->packSlots[0].curAmount -= heal;
|
||||
}
|
||||
break;
|
||||
|
@ -564,8 +564,8 @@ void packNextItem(PLAYER* pPlayer)
|
|||
|
||||
char playerSeqPlaying(PLAYER * pPlayer, int nSeq)
|
||||
{
|
||||
int nCurSeq = seqGetID(pPlayer->actor());
|
||||
if (pPlayer->pDudeInfo->seqStartID+nSeq == nCurSeq && seqGetStatus(pPlayer->actor()) >= 0)
|
||||
int nCurSeq = seqGetID(pPlayer->actor);
|
||||
if (pPlayer->pDudeInfo->seqStartID+nSeq == nCurSeq && seqGetStatus(pPlayer->actor) >= 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -665,7 +665,7 @@ void playerStart(int nPlayer, int bNewLevel)
|
|||
XSPRITE *pXSprite = &actor->x();
|
||||
pPlayer->pSprite = pSprite;
|
||||
pPlayer->pXSprite = pXSprite;
|
||||
pPlayer->nSprite = pSprite->index;
|
||||
pPlayer->actor = actor;
|
||||
DUDEINFO *pDudeInfo = &dudeInfo[kDudePlayer1 + nPlayer - kDudeBase];
|
||||
pPlayer->pDudeInfo = pDudeInfo;
|
||||
playerSetRace(pPlayer, kModeHuman);
|
||||
|
@ -754,10 +754,10 @@ void playerStart(int nPlayer, int bNewLevel)
|
|||
XSPRITE* pXCtrl = &iactor->x();
|
||||
if (pXCtrl->data1 == pPlayer->nPlayer + 1)
|
||||
{
|
||||
int nSpriteOld = pXCtrl->sysData1;
|
||||
trPlayerCtrlLink(iactor, pPlayer, (nSpriteOld < 0) ? true : false);
|
||||
if (nSpriteOld > 0)
|
||||
condUpdateObjectIndex(&bloodActors[nSpriteOld], &bloodActors[pXCtrl->sysData1]);
|
||||
auto SpriteOld = iactor->prevmarker;
|
||||
trPlayerCtrlLink(iactor, pPlayer, (SpriteOld == nullptr)); // this modifies iactor's prevmarker field!
|
||||
if (SpriteOld)
|
||||
condUpdateObjectIndex(SpriteOld, iactor->prevmarker);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -860,7 +860,7 @@ bool findDroppedLeech(PLAYER *a1, DBloodActor *a2)
|
|||
if (a2 == actor)
|
||||
continue;
|
||||
spritetype *pSprite = &actor->s();
|
||||
if (pSprite->type == kThingDroppedLifeLeech && pSprite->owner == a1->nSprite)
|
||||
if (pSprite->type == kThingDroppedLifeLeech && actor->GetOwner() == a1->actor)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -875,7 +875,7 @@ char PickupItem(PLAYER *pPlayer, DBloodActor* itemactor)
|
|||
switch (pItem->type) {
|
||||
case kItemShadowCloak:
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
if (isGrown(pPlayer->actor()) || !powerupActivate(pPlayer, nType)) return false;
|
||||
if (isGrown(pPlayer->actor) || !powerupActivate(pPlayer, nType)) return false;
|
||||
#else
|
||||
if (!powerupActivate(pPlayer, nType)) return false;
|
||||
#endif
|
||||
|
@ -887,10 +887,10 @@ char PickupItem(PLAYER *pPlayer, DBloodActor* itemactor)
|
|||
if (gModernMap) {
|
||||
switch (pItem->type) {
|
||||
case kItemShroomShrink:
|
||||
if (isShrinked(pPlayer->actor())) return false;
|
||||
if (isShrinked(pPlayer->actor)) return false;
|
||||
break;
|
||||
case kItemShroomGrow:
|
||||
if (isGrown(pPlayer->actor())) return false;
|
||||
if (isGrown(pPlayer->actor)) return false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1079,7 +1079,7 @@ char PickupItem(PLAYER *pPlayer, DBloodActor* itemactor)
|
|||
addPower = itemactor->x().data1;
|
||||
#endif
|
||||
|
||||
if (!actHealDude(pPlayer->actor(), addPower, gPowerUpInfo[nType].maxTime)) return 0;
|
||||
if (!actHealDude(pPlayer->actor, addPower, gPowerUpInfo[nType].maxTime)) return 0;
|
||||
return 1;
|
||||
}
|
||||
case kItemHealthDoctorBag:
|
||||
|
@ -1248,7 +1248,7 @@ int ActionScan(PLAYER *pPlayer, int *pIndex, int *pXIndex, DBloodActor** pAct)
|
|||
int x = bcos(pSprite->ang);
|
||||
int y = bsin(pSprite->ang);
|
||||
int z = pPlayer->slope;
|
||||
int hit = HitScan(pPlayer->actor(), pPlayer->zView, x, y, z, 0x10000040, 128);
|
||||
int hit = HitScan(pPlayer->actor, pPlayer->zView, x, y, z, 0x10000040, 128);
|
||||
int hitDist = approxDist(pSprite->x-gHitInfo.hitx, pSprite->y-gHitInfo.hity)>>4;
|
||||
if (hitDist < 64)
|
||||
{
|
||||
|
@ -1338,7 +1338,7 @@ void doslopetilting(PLAYER* pPlayer, double const scaleAdjust = 1)
|
|||
{
|
||||
auto* const pSprite = pPlayer->pSprite;
|
||||
auto* const pXSprite = pPlayer->pXSprite;
|
||||
int const florhit = pPlayer->actor()->hit.florhit.type;
|
||||
int const florhit = pPlayer->actor->hit.florhit.type;
|
||||
char const va = pXSprite->height < 16 && (florhit == kHitSector || florhit == 0) ? 1 : 0;
|
||||
pPlayer->horizon.calcviewpitch(pSprite->pos.vec2, buildang(pSprite->ang), va, sector[pSprite->sectnum].floorstat & 2, pSprite->sectnum, scaleAdjust);
|
||||
}
|
||||
|
@ -1356,7 +1356,7 @@ void ProcessInput(PLAYER *pPlayer)
|
|||
pPlayer->horizon.resetadjustment();
|
||||
pPlayer->angle.resetadjustment();
|
||||
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
spritetype *pSprite = pPlayer->pSprite;
|
||||
XSPRITE *pXSprite = pPlayer->pXSprite;
|
||||
POSTURE *pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture];
|
||||
|
@ -1389,14 +1389,14 @@ void ProcessInput(PLAYER *pPlayer)
|
|||
if (bSeqStat)
|
||||
{
|
||||
if (pPlayer->deathTime > 360)
|
||||
seqSpawn(pPlayer->pDudeInfo->seqStartID+14, pPlayer->actor(), nPlayerSurviveClient);
|
||||
seqSpawn(pPlayer->pDudeInfo->seqStartID+14, pPlayer->actor, nPlayerSurviveClient);
|
||||
}
|
||||
else if (seqGetStatus(pPlayer->actor()) < 0)
|
||||
else if (seqGetStatus(pPlayer->actor) < 0)
|
||||
{
|
||||
if (pPlayer->pSprite)
|
||||
pPlayer->pSprite->type = kThingBloodChunks;
|
||||
actPostSprite(pPlayer->actor(), kStatThing);
|
||||
seqSpawn(pPlayer->pDudeInfo->seqStartID+15, pPlayer->actor(), -1);
|
||||
actPostSprite(pPlayer->actor, kStatThing);
|
||||
seqSpawn(pPlayer->pDudeInfo->seqStartID+15, pPlayer->actor, -1);
|
||||
playerReset(pPlayer);
|
||||
if (gGameOptions.nGameType == 0 && numplayers == 1)
|
||||
{
|
||||
|
@ -1576,7 +1576,7 @@ void ProcessInput(PLAYER *pPlayer)
|
|||
pPlayer->handTime = ClipLow(pPlayer->handTime-4*(6-gGameOptions.nDifficulty), 0);
|
||||
if (pPlayer->handTime <= 0 && pPlayer->hand)
|
||||
{
|
||||
auto pactor = pPlayer->actor();
|
||||
auto pactor = pPlayer->actor;
|
||||
auto spawned = actSpawnDude(pactor, kDudeHand, pPlayer->pSprite->clipdist<<1, 0);
|
||||
if (spawned)
|
||||
{
|
||||
|
@ -1585,9 +1585,9 @@ void ProcessInput(PLAYER *pPlayer)
|
|||
int nSprite = pPlayer->pSprite->index;
|
||||
int x = bcos(pPlayer->pSprite->ang);
|
||||
int y = bsin(pPlayer->pSprite->ang);
|
||||
spawned->xvel = pPlayer->actor()->xvel + MulScale(0x155555, x, 14);
|
||||
spawned->yvel = pPlayer->actor()->yvel + MulScale(0x155555, y, 14);
|
||||
spawned->zvel = pPlayer->actor()->zvel;
|
||||
spawned->xvel = pPlayer->actor->xvel + MulScale(0x155555, x, 14);
|
||||
spawned->yvel = pPlayer->actor->yvel + MulScale(0x155555, y, 14);
|
||||
spawned->zvel = pPlayer->actor->zvel;
|
||||
}
|
||||
pPlayer->hand = 0;
|
||||
}
|
||||
|
@ -1660,7 +1660,7 @@ void ProcessInput(PLAYER *pPlayer)
|
|||
|
||||
void playerProcess(PLAYER *pPlayer)
|
||||
{
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
spritetype *pSprite = pPlayer->pSprite;
|
||||
XSPRITE *pXSprite = pPlayer->pXSprite;
|
||||
POSTURE* pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture];
|
||||
|
@ -1786,13 +1786,13 @@ void playerProcess(PLAYER *pPlayer)
|
|||
|
||||
DBloodActor* playerFireMissile(PLAYER *pPlayer, int a2, int a3, int a4, int a5, int a6)
|
||||
{
|
||||
return actFireMissile(pPlayer->actor(), a2, pPlayer->zWeapon-pPlayer->pSprite->z, a3, a4, a5, a6);
|
||||
return actFireMissile(pPlayer->actor, a2, pPlayer->zWeapon-pPlayer->pSprite->z, a3, a4, a5, a6);
|
||||
}
|
||||
|
||||
DBloodActor* playerFireThing(PLAYER *pPlayer, int a2, int a3, int thingType, int a5)
|
||||
{
|
||||
assert(thingType >= kThingBase && thingType < kThingMax);
|
||||
return actFireThing(pPlayer->actor(), a2, pPlayer->zWeapon-pPlayer->pSprite->z, pPlayer->slope+a3, thingType, a5);
|
||||
return actFireThing(pPlayer->actor, a2, pPlayer->zWeapon-pPlayer->pSprite->z, pPlayer->slope+a3, thingType, a5);
|
||||
}
|
||||
|
||||
void playerFrag(PLAYER *pKiller, PLAYER *pVictim)
|
||||
|
@ -1903,7 +1903,7 @@ int playerDamageArmor(PLAYER *pPlayer, DAMAGE_TYPE nType, int nDamage)
|
|||
|
||||
void flagDropped(PLAYER *pPlayer, int a2)
|
||||
{
|
||||
auto playeractor = pPlayer->actor();
|
||||
auto playeractor = pPlayer->actor;
|
||||
DBloodActor* actor;
|
||||
char buffer[80];
|
||||
spritetype *pSprite = NULL;
|
||||
|
@ -1940,7 +1940,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage
|
|||
|
||||
spritetype *pSprite = pPlayer->pSprite;
|
||||
XSPRITE *pXSprite = pPlayer->pXSprite;
|
||||
auto pActor = pPlayer->actor();
|
||||
auto pActor = pPlayer->actor;
|
||||
int nXSprite = pSprite->extra;
|
||||
int nXSector = sector[pSprite->sectnum].extra;
|
||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||
|
@ -2039,7 +2039,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage
|
|||
nKneelingPlayer = nPlayerKneelClient;
|
||||
powerupActivate(pPlayer, kPwUpDeliriumShroom);
|
||||
pActor->SetTarget(source);
|
||||
evPostActor(pPlayer->actor(), 15, kCallbackFinishHim);
|
||||
evPostActor(pPlayer->actor, 15, kCallbackFinishHim);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2059,7 +2059,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage
|
|||
pSprite->flags |= 7;
|
||||
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
||||
{
|
||||
if (gPlayer[p].fragger == pPlayer->actor() && gPlayer[p].deathTime > 0)
|
||||
if (gPlayer[p].fragger == pPlayer->actor && gPlayer[p].deathTime > 0)
|
||||
gPlayer[p].fragger = nullptr;
|
||||
}
|
||||
FragPlayer(pPlayer, source);
|
||||
|
@ -2092,7 +2092,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage
|
|||
|
||||
}
|
||||
assert(getSequence(pDudeInfo->seqStartID + nDeathSeqID) != NULL);
|
||||
seqSpawn(pDudeInfo->seqStartID+nDeathSeqID, pPlayer->actor(), nKneelingPlayer);
|
||||
seqSpawn(pDudeInfo->seqStartID+nDeathSeqID, pPlayer->actor, nKneelingPlayer);
|
||||
return nDamage;
|
||||
}
|
||||
|
||||
|
@ -2108,7 +2108,7 @@ int UseAmmo(PLAYER *pPlayer, int nAmmoType, int nDec)
|
|||
|
||||
void voodooTarget(PLAYER *pPlayer)
|
||||
{
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
int v4 = pPlayer->aim.dz;
|
||||
int dz = pPlayer->zWeapon-pPlayer->pSprite->z;
|
||||
if (UseAmmo(pPlayer, 9, 0) < 8)
|
||||
|
@ -2146,7 +2146,7 @@ void playerLandingSound(PLAYER *pPlayer)
|
|||
603
|
||||
};
|
||||
spritetype *pSprite = pPlayer->pSprite;
|
||||
SPRITEHIT* pHit = &pPlayer->actor()->hit;
|
||||
SPRITEHIT* pHit = &pPlayer->actor->hit;
|
||||
if (pHit->florhit.type != kHitNone)
|
||||
{
|
||||
if (!gGameOptions.bFriendlyFire && pHit->florhit.type == kHitSprite && IsTargetTeammate(pPlayer, &pHit->florhit.actor->s()))
|
||||
|
@ -2254,7 +2254,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER*
|
|||
if (arc.isReading()) playerResetPosture(&w);
|
||||
if (arc.BeginObject(keyname))
|
||||
{
|
||||
arc("spritenum", w.nSprite)
|
||||
arc("spritenum", w.actor)
|
||||
("horizon", w.horizon)
|
||||
("angle", w.angle)
|
||||
("newweapon", w.newWeapon)
|
||||
|
@ -2378,8 +2378,8 @@ void SerializePlayers(FSerializer& arc)
|
|||
{
|
||||
for (int i = 0; i < gNetPlayers; i++)
|
||||
{
|
||||
gPlayer[i].pSprite = &sprite[gPlayer[i].nSprite];
|
||||
gPlayer[i].pXSprite = &xsprite[gPlayer[i].pSprite->extra];
|
||||
gPlayer[i].pSprite = &gPlayer[i].actor->s();
|
||||
gPlayer[i].pXSprite = &gPlayer[i].actor->x();
|
||||
gPlayer[i].pDudeInfo = &dudeInfo[gPlayer[i].pSprite->type - kDudeBase];
|
||||
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
|
@ -2419,7 +2419,6 @@ DEFINE_FIELD_X(BloodPlayer, PLAYER, swayAmp)
|
|||
DEFINE_FIELD_X(BloodPlayer, PLAYER, swayHeight)
|
||||
DEFINE_FIELD_X(BloodPlayer, PLAYER, swayWidth)
|
||||
DEFINE_FIELD_X(BloodPlayer, PLAYER, nPlayer) // Connect id
|
||||
DEFINE_FIELD_X(BloodPlayer, PLAYER, nSprite)
|
||||
DEFINE_FIELD_X(BloodPlayer, PLAYER, lifeMode)
|
||||
DEFINE_FIELD_X(BloodPlayer, PLAYER, zView)
|
||||
DEFINE_FIELD_X(BloodPlayer, PLAYER, zViewVel)
|
||||
|
|
|
@ -81,7 +81,7 @@ extern POSTURE gPostureDefaults[kModeMax][kPostureMax];
|
|||
|
||||
struct PLAYER
|
||||
{
|
||||
DBloodActor* actor();
|
||||
DBloodActor* actor;
|
||||
spritetype* pSprite;
|
||||
XSPRITE* pXSprite;
|
||||
DUDEINFO* pDudeInfo;
|
||||
|
@ -104,7 +104,6 @@ struct PLAYER
|
|||
int swayHeight;
|
||||
int swayWidth;
|
||||
int nPlayer; // Connect id
|
||||
int nSprite;
|
||||
int lifeMode;
|
||||
int bloodlust; // ---> useless
|
||||
int zView;
|
||||
|
|
|
@ -62,14 +62,14 @@ void viewInitializePrediction(void)
|
|||
predict.z = gMe->pSprite->z;
|
||||
predict.sectnum = gMe->pSprite->sectnum;
|
||||
predict.at73 = gMe->pSprite->flags;
|
||||
predict.xvel = gMe->actor()->xvel;
|
||||
predict.yvel = gMe->actor()->yvel;
|
||||
predict.zvel = gMe->actor()->zvel;
|
||||
predict.xvel = gMe->actor->xvel;
|
||||
predict.yvel = gMe->actor->yvel;
|
||||
predict.zvel = gMe->actor->zvel;
|
||||
predict.floordist = gMe->pXSprite->height;
|
||||
predict.at48 = gMe->posture;
|
||||
predict.spin = gMe->angle.spin;
|
||||
predict.at6e = !!(gMe->input.actions & SB_CENTERVIEW);
|
||||
predict.at75 = gMe->actor()->hit;
|
||||
predict.at75 = gMe->actor->hit;
|
||||
predict.bobPhase = gMe->bobPhase;
|
||||
predict.Kills = gMe->bobAmp;
|
||||
predict.bobHeight = gMe->bobHeight;
|
||||
|
|
|
@ -205,7 +205,7 @@ void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, b
|
|||
|
||||
void QAV::Play(int start, int end, int nCallback, PLAYER *pData)
|
||||
{
|
||||
auto pActor = pData ? pData->actor() : nullptr;
|
||||
auto pActor = pData ? pData->actor : nullptr;
|
||||
assert(ticksPerFrame > 0);
|
||||
int frame;
|
||||
int ticks;
|
||||
|
|
|
@ -118,7 +118,7 @@ void viewDrawAimedPlayerName(void)
|
|||
if (!cl_idplayers || (gView->aim.dx == 0 && gView->aim.dy == 0))
|
||||
return;
|
||||
|
||||
int hit = HitScan(gView->actor(), gView->zView, gView->aim.dx, gView->aim.dy, gView->aim.dz, CLIPMASK0, 512);
|
||||
int hit = HitScan(gView->actor, gView->zView, gView->aim.dx, gView->aim.dy, gView->aim.dz, CLIPMASK0, 512);
|
||||
if (hit == 3)
|
||||
{
|
||||
if (gHitInfo.hitactor && gHitInfo.hitactor->IsPlayerActor())
|
||||
|
@ -687,7 +687,7 @@ void viewDrawScreen(bool sceneonly)
|
|||
int nClipDist = gView->pSprite->clipdist << 2;
|
||||
int vec, vf4;
|
||||
Collision c1, c2;
|
||||
GetZRange(gView->actor(), &vf4, &c1, &vec, &c2, nClipDist, 0);
|
||||
GetZRange(gView->actor, &vf4, &c1, &vec, &c2, nClipDist, 0);
|
||||
if (sceneonly) return;
|
||||
#if 0
|
||||
int tmpSect = nSectnum;
|
||||
|
@ -776,7 +776,7 @@ bool GameInterface::DrawAutomapPlayer(int x, int y, int z, int a, double const s
|
|||
int nTile = pSprite->picnum;
|
||||
int ceilZ, floorZ;
|
||||
Collision ceilHit, floorHit;
|
||||
GetZRange(gView->actor(), &ceilZ, &ceilHit, &floorZ, &floorHit, (pSprite->clipdist << 2) + 16, CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR);
|
||||
GetZRange(gView->actor, &ceilZ, &ceilHit, &floorZ, &floorHit, (pSprite->clipdist << 2) + 16, CLIPMASK0, PARALLAXCLIP_CEILING | PARALLAXCLIP_FLOOR);
|
||||
int nTop, nBottom;
|
||||
GetSpriteExtents(pSprite, &nTop, &nBottom);
|
||||
int nScale = (pSprite->yrepeat + ((floorZ - nBottom) >> 8)) * z;
|
||||
|
|
|
@ -214,7 +214,7 @@ void SpawnBulletEject(PLAYER *pPlayer, int a2, int a3)
|
|||
POSTURE *pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture];
|
||||
pPlayer->zView = pPlayer->pSprite->z-pPosture->eyeAboveZ;
|
||||
int dz = pPlayer->zWeapon-(pPlayer->zWeapon-pPlayer->zView)/2;
|
||||
fxSpawnEjectingBrass(pPlayer->actor(), dz, a2, a3);
|
||||
fxSpawnEjectingBrass(pPlayer->actor, dz, a2, a3);
|
||||
}
|
||||
|
||||
void SpawnShellEject(PLAYER *pPlayer, int a2, int a3)
|
||||
|
@ -223,7 +223,7 @@ void SpawnShellEject(PLAYER *pPlayer, int a2, int a3)
|
|||
pPlayer->zView = pPlayer->pSprite->z-pPosture->eyeAboveZ;
|
||||
int t = pPlayer->zWeapon - pPlayer->zView;
|
||||
int dz = pPlayer->zWeapon-t+(t>>2);
|
||||
fxSpawnEjectingShell(pPlayer->actor(), dz, a2, a3);
|
||||
fxSpawnEjectingShell(pPlayer->actor, dz, a2, a3);
|
||||
}
|
||||
|
||||
void WeaponInit(void)
|
||||
|
@ -1060,7 +1060,7 @@ void WeaponUpdateState(PLAYER *pPlayer)
|
|||
|
||||
void FirePitchfork(int, PLAYER *pPlayer)
|
||||
{
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
Aim *aim = &pPlayer->aim;
|
||||
int r1 = Random2(2000);
|
||||
int r2 = Random2(2000);
|
||||
|
@ -1217,7 +1217,7 @@ enum { kMaxShotgunBarrels = 4 };
|
|||
|
||||
void FireShotgun(int nTrigger, PLAYER *pPlayer)
|
||||
{
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
assert(nTrigger > 0 && nTrigger <= kMaxShotgunBarrels);
|
||||
if (nTrigger == 1)
|
||||
{
|
||||
|
@ -1264,7 +1264,7 @@ void EjectShell(int, PLAYER *pPlayer)
|
|||
|
||||
void FireTommy(int nTrigger, PLAYER *pPlayer)
|
||||
{
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
Aim *aim = &pPlayer->aim;
|
||||
sfxPlay3DSound(pPlayer->pSprite, 431, -1, 0);
|
||||
switch (nTrigger)
|
||||
|
@ -1303,7 +1303,7 @@ enum { kMaxSpread = 14 };
|
|||
|
||||
void FireSpread(int nTrigger, PLAYER *pPlayer)
|
||||
{
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
||||
Aim *aim = &pPlayer->aim;
|
||||
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
||||
|
@ -1325,7 +1325,7 @@ void FireSpread(int nTrigger, PLAYER *pPlayer)
|
|||
|
||||
void AltFireSpread(int nTrigger, PLAYER *pPlayer)
|
||||
{
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
||||
Aim *aim = &pPlayer->aim;
|
||||
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
||||
|
@ -1355,7 +1355,7 @@ void AltFireSpread(int nTrigger, PLAYER *pPlayer)
|
|||
|
||||
void AltFireSpread2(int nTrigger, PLAYER *pPlayer)
|
||||
{
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
||||
Aim *aim = &pPlayer->aim;
|
||||
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
||||
|
@ -1448,7 +1448,7 @@ void AltFireFlare(int nTrigger, PLAYER *pPlayer)
|
|||
void FireVoodoo(int nTrigger, PLAYER *pPlayer)
|
||||
{
|
||||
nTrigger--;
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
spritetype *pSprite = pPlayer->pSprite;
|
||||
if (nTrigger == 4)
|
||||
{
|
||||
|
@ -1506,7 +1506,7 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer)
|
|||
|
||||
void AltFireVoodoo(int nTrigger, PLAYER *pPlayer)
|
||||
{
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
if (nTrigger == 2) {
|
||||
|
||||
// by NoOne: trying to simulate v1.0x voodoo here.
|
||||
|
@ -1692,7 +1692,7 @@ void AltFireNapalm(int , PLAYER *pPlayer)
|
|||
pXSprite->data4 = ClipHigh(pPlayer->ammoCount[4], 12);
|
||||
UseAmmo(pPlayer, 4, pXSprite->data4);
|
||||
seqSpawn(22, missile, -1);
|
||||
actBurnSprite(pPlayer->actor(), missile, 600);
|
||||
actBurnSprite(pPlayer->actor, missile, 600);
|
||||
evPostActor(missile, 0, kCallbackFXFlameLick);
|
||||
sfxPlay3DSound(missile, 480, 2, 0);
|
||||
pPlayer->visibility = 30;
|
||||
|
@ -1707,7 +1707,7 @@ void FireLifeLeech(int nTrigger, PLAYER *pPlayer)
|
|||
int r1 = Random2(2000);
|
||||
int r2 = Random2(2000);
|
||||
int r3 = Random2(1000);
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
auto missileActor = playerFireMissile(pPlayer, 0, pPlayer->aim.dx+r1, pPlayer->aim.dy+r2, pPlayer->aim.dz+r3, 315);
|
||||
if (missileActor)
|
||||
{
|
||||
|
@ -1723,7 +1723,7 @@ void FireLifeLeech(int nTrigger, PLAYER *pPlayer)
|
|||
|
||||
void AltFireLifeLeech(int , PLAYER *pPlayer)
|
||||
{
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
sfxPlay3DSound(pPlayer->pSprite, 455, 2, 0);
|
||||
auto missile = playerFireThing(pPlayer, 0, -4730, kThingDroppedLifeLeech, 0x19999);
|
||||
if (missile)
|
||||
|
@ -1759,7 +1759,7 @@ void AltFireLifeLeech(int , PLAYER *pPlayer)
|
|||
|
||||
void FireBeast(int , PLAYER * pPlayer)
|
||||
{
|
||||
auto actor = pPlayer->actor();
|
||||
auto actor = pPlayer->actor;
|
||||
int r1 = Random2(2000);
|
||||
int r2 = Random2(2000);
|
||||
int r3 = Random2(2000);
|
||||
|
|
|
@ -73,7 +73,7 @@ struct BloodPlayer native
|
|||
native int swayHeight;
|
||||
native int swayWidth;
|
||||
native int nPlayer; // Connect id
|
||||
native int nSprite;
|
||||
//native int nSprite;
|
||||
native int lifeMode;
|
||||
native int zView;
|
||||
native int zViewVel;
|
||||
|
|
Loading…
Reference in a new issue