- more changesprite* renaming.

This commit is contained in:
Christoph Oelckers 2021-08-27 16:38:53 +02:00
parent 1bbcca5f28
commit b8f8c0fe04
4 changed files with 23 additions and 19 deletions

View file

@ -4652,7 +4652,7 @@ int MoveThing(DBloodActor* actor)
if (pSprite->sectnum != nSector)
{
assert(nSector >= 0 && nSector < kMaxSectors);
ChangeSpriteSect(pSprite->index, nSector);
ChangeActorSect(actor, nSector);
}
Collision coll(actor->hit().hit);
@ -4963,7 +4963,7 @@ void MoveDude(DBloodActor* actor)
pXSector = nullptr;
if (pXSector && pXSector->Exit && (pPlayer || !pXSector->dudeLockout))
trTriggerSector(pSprite->sectnum, pXSector, kCmdSectorExit);
ChangeSpriteSect(pSprite->index, nSector);
ChangeActorSect(actor, nSector);
nXSector = sector[nSector].extra;
pXSector = (nXSector > 0) ? &xsector[nXSector] : nullptr;
@ -5468,7 +5468,7 @@ int MoveMissile(DBloodActor* actor)
if (nSector >= 0 && nSector != pSprite->sectnum)
{
assert(nSector >= 0 && nSector < kMaxSectors);
ChangeSpriteSect(pSprite->index, nSector);
ChangeActorSect(actor, nSector);
}
CheckLink(pSprite);
gHitInfo.hitsect = pSprite->sectnum;

View file

@ -318,4 +318,13 @@ inline void sfxKill3DSound(DBloodActor* pSprite, int a2 = -1, int a3 = -1)
sfxKill3DSound(&pSprite->s(), a2, a3);
}
void ChangeActorStat(DBloodActor* actor, int stat)
{
ChangeSpriteStat(actor->s().index, stat);
}
void ChangeActorSect(DBloodActor* actor, int stat)
{
ChangeSpriteSect(actor->s().index, stat);
}
END_BLD_NS

View file

@ -227,7 +227,7 @@ void CFX::fxProcess(void)
if (nSector != pSprite->sectnum)
{
assert(nSector >= 0 && nSector < kMaxSectors);
ChangeSpriteSect(actor->s().index, nSector);
ChangeActorSect(actor, nSector);
}
}
if (actor->xvel() || actor->yvel() || actor->zvel())

View file

@ -255,11 +255,6 @@ CONDITION_TYPE_NAMES gCondTypeNames[7] = {
// for actor.cpp
//-------------------------------------------------------------------------
void changeactorstat(DBloodActor* actor, int stat)
{
changespritestat(actor->s().index, stat);
}
//---------------------------------------------------------------------------
//
//
@ -416,7 +411,7 @@ bool nnExtEraseModernStuff(DBloodActor* actor)
case kModernThingTNTProx:
case kModernThingEnemyLifeLeech:
pSprite->type = kSpriteDecoration;
changeactorstat(actor, kStatDecoration);
ChangeActorStat(actor, kStatDecoration);
erased = true;
break;
// also erase some modernized vanilla types which was not active
@ -652,11 +647,11 @@ void nnExtInitModernStuff(bool bSaveLoad)
case kModernSequentialTX:
if (pXSprite->command != kCmdLink) break;
// add statnum for faster redirects search
changeactorstat(actor, kStatModernEventRedirector);
ChangeActorStat(actor, kStatModernEventRedirector);
break;
case kModernWindGenerator:
pSprite->cstat &= ~CSTAT_SPRITE_BLOCK;
changeactorstat(actor, kStatModernWindGen);
ChangeActorStat(actor, kStatModernWindGen);
break;
case kModernDudeTargetChanger:
case kModernObjDataAccumulator:
@ -669,18 +664,18 @@ void nnExtInitModernStuff(bool bSaveLoad)
{
// stealth regions for patrolling enemies
case kModernStealthRegion:
changeactorstat(actor, kStatModernStealthRegion);
ChangeActorStat(actor, kStatModernStealthRegion);
break;
// add statnum for faster dude searching
case kModernDudeTargetChanger:
changeactorstat(actor, kStatModernDudeTargetChanger);
ChangeActorStat(actor, kStatModernDudeTargetChanger);
if (pXSprite->busyTime <= 0) pXSprite->busyTime = 5;
pXSprite->command = kCmdLink;
break;
// remove kStatItem status from random item generators
case kModernRandom:
case kModernRandom2:
changeactorstat(actor, kStatDecoration);
ChangeActorStat(actor, kStatDecoration);
pXSprite->sysData1 = pXSprite->command; // save the command so spawned item can inherit it
pXSprite->command = kCmdLink; // generator itself can't send commands
break;
@ -699,7 +694,7 @@ void nnExtInitModernStuff(bool bSaveLoad)
XSPRITE* pXSpr = &iactor->x();
if (pXSpr->rxID != pXSprite->txID) continue;
else if (found) I_Error("\nCustom dude (TX ID %d):\nOnly one incarnation allowed per channel!", pXSprite->txID);
changeactorstat(iactor, kStatInactive);
ChangeActorStat(iactor, kStatInactive);
found++;
}
break;
@ -736,12 +731,12 @@ void nnExtInitModernStuff(bool bSaveLoad)
}
pXSprite->sysData1 = -1;
pSprite->cstat &= ~CSTAT_SPRITE_BLOCK;
changeactorstat(actor, kStatModernPlayerLinker);
ChangeActorStat(actor, kStatModernPlayerLinker);
break;
}
case 67: // play qav animation
if (pXSprite->txID && !pXSprite->waitTime) pXSprite->waitTime = 1;
changeactorstat(actor, kStatModernQavScene);
ChangeActorStat(actor, kStatModernQavScene);
break;
}
break;
@ -767,7 +762,7 @@ void nnExtInitModernStuff(bool bSaveLoad)
pXSprite->targetX = pXSprite->targetY = pXSprite->targetZ = pXSprite->sysData2 = -1;
actor->SetTarget(nullptr);
changespritestat(pSprite->index, kStatModernCondition);
ChangeActorStat(actor, kStatModernCondition);
int oldStat = pSprite->cstat; pSprite->cstat = 0x30;
if (oldStat & CSTAT_SPRITE_BLOCK)