wrap all write access to spr.type.

This commit is contained in:
Christoph Oelckers 2023-09-30 10:01:27 +02:00
parent 7379288f4b
commit 95290c65b2
11 changed files with 78 additions and 71 deletions

View file

@ -2527,7 +2527,7 @@ void actInit(TArray<DBloodActor*>& actors)
{
if (act->spr.type == kItemWeaponVoodooDoll)
{
act->spr.type = kItemAmmoVoodooDoll;
act->ChangeType(kItemAmmoVoodooDoll);
break;
}
}
@ -2745,7 +2745,7 @@ static DBloodActor* actDropAmmo(DBloodActor* actor, int nType)
{
auto act2 = actSpawnFloor(actor);
const AMMOITEMDATA* pAmmo = &gAmmoItemData[nType - kItemAmmoBase];
act2->spr.type = nType;
act2->ChangeType(nType);
act2->spr.setspritetexture(pAmmo->textureID());
act2->spr.shade = pAmmo->shade;
act2->spr.scale = DVector2(pAmmo->xrepeat * REPEAT_SCALE, pAmmo->yrepeat * REPEAT_SCALE);
@ -2761,7 +2761,7 @@ static DBloodActor* actDropWeapon(DBloodActor* actor, int nType)
{
auto act2 = actSpawnFloor(actor);
const WEAPONITEMDATA* pWeapon = &gWeaponItemData[nType - kItemWeaponBase];
act2->spr.type = nType;
act2->ChangeType(nType);
act2->spr.setspritetexture(pWeapon->textureID());
act2->spr.shade = pWeapon->shade;
act2->spr.scale = DVector2(pWeapon->xrepeat * REPEAT_SCALE, pWeapon->yrepeat * REPEAT_SCALE);
@ -2777,7 +2777,7 @@ static DBloodActor* actDropItem(DBloodActor* actor, int nType)
{
auto act2 = actSpawnFloor(actor);
const ITEMDATA* pItem = &gItemData[nType - kItemBase];
act2->spr.type = nType;
act2->ChangeType(nType);
act2->spr.setspritetexture(pItem->textureID());
act2->spr.shade = pItem->shade;
act2->spr.scale = DVector2(pItem->xrepeat * REPEAT_SCALE, pItem->yrepeat * REPEAT_SCALE);
@ -2903,7 +2903,7 @@ static bool actKillModernDude(DBloodActor* actor, DAMAGE_TYPE damageType)
{
if (pExtra->canBurn)
{
actor->spr.type = kDudeModernCustomBurning;
actor->ChangeType(kDudeModernCustomBurning);
if (actor->xspr.data2 == kGenDudeDefaultSeq) // don't inherit palette for burning if using default animation
actor->spr.pal = 0;
@ -2999,7 +2999,7 @@ static bool actKillDudeStage1(DBloodActor* actor, DAMAGE_TYPE damageType)
case kDudeCultistTNT:
if (damageType == kDamageBurn && actor->xspr.medium == kMediumNormal)
{
actor->spr.type = kDudeBurningCultist;
actor->ChangeType(kDudeBurningCultist);
aiNewState(actor, &cultistBurnGoto);
actHealDude(actor, dudeInfo[40].startHealth, dudeInfo[40].startHealth);
return true;
@ -3009,7 +3009,7 @@ static bool actKillDudeStage1(DBloodActor* actor, DAMAGE_TYPE damageType)
case kDudeBeast:
if (damageType == kDamageBurn && actor->xspr.medium == kMediumNormal)
{
actor->spr.type = kDudeBurningBeast;
actor->ChangeType(kDudeBurningBeast);
aiNewState(actor, &beastBurnGoto);
actHealDude(actor, dudeInfo[53].startHealth, dudeInfo[53].startHealth);
return true;
@ -3019,7 +3019,7 @@ static bool actKillDudeStage1(DBloodActor* actor, DAMAGE_TYPE damageType)
case kDudeInnocent:
if (damageType == kDamageBurn && actor->xspr.medium == kMediumNormal)
{
actor->spr.type = kDudeBurningInnocent;
actor->ChangeType(kDudeBurningInnocent);
aiNewState(actor, &innocentBurnGoto);
actHealDude(actor, dudeInfo[39].startHealth, dudeInfo[39].startHealth);
return true;
@ -3031,7 +3031,7 @@ static bool actKillDudeStage1(DBloodActor* actor, DAMAGE_TYPE damageType)
break;
if (damageType == kDamageBurn && actor->xspr.medium == kMediumNormal)
{
actor->spr.type = kDudeBurningTinyCaleb;
actor->ChangeType(kDudeBurningTinyCaleb);
aiNewState(actor, &tinycalebBurnGoto);
actHealDude(actor, dudeInfo[39].startHealth, dudeInfo[39].startHealth);
return true;
@ -3578,7 +3578,7 @@ void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damag
}
AddKill(killerActor, actor);
actCheckRespawn(actor);
actor->spr.type = kThingBloodChunks;
actor->ChangeType(kThingBloodChunks);
actPostSprite(actor, kStatThing);
}
@ -3838,7 +3838,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
{
actPostSprite(missileActor, kStatDecoration);
if (missileActor->spr.Angles.Yaw == DAngle180) sfxPlay3DSound(missileActor, 307, -1, 0);
missileActor->spr.type = kSpriteDecoration;
missileActor->ChangeType(kSpriteDecoration);
seqSpawn(9, missileActor, -1);
}
else
@ -4020,7 +4020,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
case kMissileButcherKnife:
actPostSprite(missileActor, kStatDebris);
missileActor->spr.cstat &= ~CSTAT_SPRITE_ALIGNMENT_WALL;
missileActor->spr.type = kSpriteDecoration;
missileActor->ChangeType(kSpriteDecoration);
seqSpawn(20, missileActor, -1);
if (hitCode == 3 && actorHit && actorHit->hasX())
{
@ -4972,11 +4972,11 @@ void MoveDude(DBloodActor* actor)
{
const bool fixRandomCultist = !cl_bloodvanillaenemies && (actor->spr.inittype >= kDudeBase) && (actor->spr.inittype < kDudeMax) && (actor->spr.inittype != actor->spr.type) && !VanillaMode(); // fix burning cultists randomly switching types underwater
if (Chance(chance))
actor->spr.type = kDudeCultistTommy;
actor->ChangeType(kDudeCultistTommy);
else
actor->spr.type = kDudeCultistShotgun;
actor->ChangeType(kDudeCultistShotgun);
if (fixRandomCultist) // fix burning cultists randomly switching types underwater
actor->spr.type = actor->spr.inittype; // restore back to spawned cultist type
actor->ChangeType(actor->spr.inittype); // restore back to spawned cultist type
actor->xspr.burnTime = 0;
evPostActor(actor, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(actor, 720, -1, 0);
@ -5449,7 +5449,7 @@ void actExplodeSprite(DBloodActor* actor)
actor->spr.scale = DVector2(explodeInfo[nType].repeat * REPEAT_SCALE, explodeInfo[nType].repeat* REPEAT_SCALE);
actor->spr.flags &= ~3;
actor->spr.type = nType;
actor->ChangeType(nType);
const EXPLOSION* pExplodeInfo = &explodeInfo[nType];
actor->SetTarget(nullptr);
actor->explosionhackflag = true;
@ -5954,7 +5954,7 @@ static void actCheckDudes()
if (actor->xspr.health <= 0 && seqGetStatus(actor) < 0)
{
actor->xspr.health = dudeInfo[28].startHealth << 4;
actor->spr.type = kDudeCerberusOneHead;
actor->ChangeType(kDudeCerberusOneHead);
if (actor->GetTarget() != nullptr) aiSetTarget(actor, actor->GetTarget());
aiActivateDude(actor);
}
@ -6136,7 +6136,7 @@ DBloodActor* actSpawnSprite(sectortype* pSector, const DVector3& pos, int nStat,
DBloodActor* actor = InsertSprite(pSector, nStat);
SetActor(actor, pos);
actor->spr.type = kSpriteDecoration;
actor->ChangeType(kSpriteDecoration);
if (setextra && !actor->hasX())
{
actor->addX();
@ -6186,7 +6186,7 @@ DBloodActor* actSpawnDude(DBloodActor* source, int nType, double dist)
{
pos.XY() += angle.ToVector() * dist;
}
spawned->spr.type = nType;
spawned->ChangeType(nType);
if (!VanillaMode())
spawned->spr.inittype = nType;
spawned->spr.Angles.Yaw = angle;
@ -6246,7 +6246,7 @@ DBloodActor* actSpawnThing(sectortype* pSector, const DVector3& pos, int nThingT
assert(nThingType >= kThingBase && nThingType < kThingMax);
auto actor = actSpawnSprite(pSector, pos, 4, 1);
int nType = nThingType - kThingBase;
actor->spr.type = nThingType;
actor->ChangeType(nThingType);
assert(actor->hasX());
const THINGINFO* pThingInfo = &thingInfo[nType];
actor->xspr.health = pThingInfo->startHealth << 4;
@ -6464,7 +6464,7 @@ DBloodActor* actFireMissile(DBloodActor* actor, double xyoff, double zoff, DVect
auto spawned = actSpawnSprite(actor->sector(), vect, 5, 1);
spawned->spr.cstat2 |= CSTAT2_SPRITE_MAPPED;
spawned->spr.type = nType;
spawned->ChangeType(nType);
spawned->spr.shade = pMissileInfo->shade;
spawned->spr.pal = 0;
spawned->clipdist = pMissileInfo->fClipDist();
@ -6890,7 +6890,7 @@ void Fx33Callback(int, DBloodActor* actor)
void TreeToGibCallback(int, DBloodActor* actor)
{
actor->spr.type = kThingObjectExplode;
actor->ChangeType(kThingObjectExplode);
actor->xspr.state = 1;
actor->xspr.data1 = 15;
actor->xspr.data2 = 0;
@ -6902,7 +6902,7 @@ void TreeToGibCallback(int, DBloodActor* actor)
void DudeToGibCallback1(int, DBloodActor* actor)
{
actor->spr.type = kThingBloodChunks;
actor->ChangeType(kThingBloodChunks);
actor->xspr.data1 = 8;
actor->xspr.data2 = 0;
actor->xspr.data3 = 0;
@ -6917,7 +6917,7 @@ void DudeToGibCallback1(int, DBloodActor* actor)
void DudeToGibCallback2(int, DBloodActor* actor)
{
actor->spr.type = kThingBloodChunks;
actor->ChangeType(kThingBloodChunks);
actor->xspr.data1 = 3;
actor->xspr.data2 = 0;
actor->xspr.data3 = 0;

View file

@ -446,7 +446,7 @@ void aiActivateDude(DBloodActor* actor)
{
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
pDudeExtraE->active = 1;
actor->spr.type = kDudeCultistTommy;
actor->ChangeType(kDudeCultistTommy);
if (actor->GetTarget() == nullptr)
{
switch (actor->xspr.medium)
@ -483,7 +483,7 @@ void aiActivateDude(DBloodActor* actor)
{
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
pDudeExtraE->active = 1;
actor->spr.type = kDudeCultistShotgun;
actor->ChangeType(kDudeCultistShotgun);
if (actor->GetTarget() == nullptr)
{
switch (actor->xspr.medium)
@ -1003,7 +1003,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
if (actor->xspr.burnTime == 0) actor->xspr.burnTime = 2400;
if (spriteIsUnderwater(actor, false))
{
actor->spr.type = kDudeModernCustom;
actor->ChangeType(kDudeModernCustom);
actor->xspr.burnTime = 0;
actor->xspr.health = 1; // so it can be killed with flame weapons while underwater and if already was burning dude before.
aiGenDudeNewState(actor, &genDudeGotoW);
@ -1039,7 +1039,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
aiPlay3DSound(actor, 361, AI_SFX_PRIORITY_0, -1);
playGenDudeSound(actor,kGenDudeSndBurning);
actor->spr.type = kDudeModernCustomBurning;
actor->ChangeType(kDudeModernCustomBurning);
if (actor->xspr.data2 == kGenDudeDefaultSeq) // don't inherit palette for burning if using default animation
actor->spr.pal = 0;
@ -1115,7 +1115,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
}
else if (nDmgType == kDamageBurn && actor->xspr.health <= (unsigned int)pDudeInfo->fleeHealth/* && (actor->xspr.at17_6 != 1 || actor->xspr.at17_6 != 2)*/)
{
actor->spr.type = kDudeBurningCultist;
actor->ChangeType(kDudeBurningCultist);
aiNewState(actor, &cultistBurnGoto);
aiPlay3DSound(actor, 361, AI_SFX_PRIORITY_0, -1);
aiPlay3DSound(actor, 1031 + Random(2), AI_SFX_PRIORITY_2, -1);
@ -1127,7 +1127,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
case kDudeInnocent:
if (nDmgType == kDamageBurn && actor->xspr.health <= (unsigned int)pDudeInfo->fleeHealth/* && (actor->xspr.at17_6 != 1 || actor->xspr.at17_6 != 2)*/)
{
actor->spr.type = kDudeBurningInnocent;
actor->ChangeType(kDudeBurningInnocent);
aiNewState(actor, &cultistBurnGoto);
aiPlay3DSound(actor, 361, AI_SFX_PRIORITY_0, -1);
actor->dudeExtra.time = PlayClock + 360;
@ -1143,17 +1143,17 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
}
if (Chance(0x600) && (actor->xspr.medium == kMediumWater || actor->xspr.medium == kMediumGoo))
{
actor->spr.type = kDudeCultistTommy;
actor->ChangeType(kDudeCultistTommy);
if (fixRandomCultist) // fix burning cultists randomly switching types underwater
actor->spr.type = actor->spr.inittype; // restore back to spawned cultist type
actor->ChangeType(actor->spr.inittype); // restore back to spawned cultist type
actor->xspr.burnTime = 0;
aiNewState(actor, &cultistSwimGoto);
}
else if (actor->xspr.medium == kMediumWater || actor->xspr.medium == kMediumGoo)
{
actor->spr.type = kDudeCultistShotgun;
actor->ChangeType(kDudeCultistShotgun);
if (fixRandomCultist) // fix burning cultists randomly switching types underwater
actor->spr.type = actor->spr.inittype; // restore back to spawned cultist type
actor->ChangeType(actor->spr.inittype); // restore back to spawned cultist type
actor->xspr.burnTime = 0;
aiNewState(actor, &cultistSwimGoto);
}
@ -1165,7 +1165,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
if (nDmgType == kDamageBurn && actor->xspr.health <= (unsigned int)pDudeInfo->fleeHealth) {
aiPlay3DSound(actor, 361, AI_SFX_PRIORITY_0, -1);
aiPlay3DSound(actor, 1202, AI_SFX_PRIORITY_2, -1);
actor->spr.type = kDudeBurningZombieButcher;
actor->ChangeType(kDudeBurningZombieButcher);
aiNewState(actor, &zombieFBurnGoto);
actHealDude(actor, dudeInfo[42].startHealth, dudeInfo[42].startHealth);
evKillActor(actor, kCallbackFXFlameLick);
@ -1176,12 +1176,12 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
{
if (!cl_bloodvanillaenemies && !VanillaMode()) // fix burning sprite for tiny caleb
{
actor->spr.type = kDudeBurningTinyCaleb;
actor->ChangeType(kDudeBurningTinyCaleb);
aiNewState(actor, &tinycalebBurnGoto);
}
else
{
actor->spr.type = kDudeBurningInnocent;
actor->ChangeType(kDudeBurningInnocent);
aiNewState(actor, &cultistBurnGoto);
}
aiPlay3DSound(actor, 361, AI_SFX_PRIORITY_0, -1);
@ -1193,7 +1193,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
case kDudeCultistBeast:
if (actor->xspr.health <= (unsigned int)pDudeInfo->fleeHealth)
{
actor->spr.type = kDudeBeast;
actor->ChangeType(kDudeBeast);
aiPlay3DSound(actor, 9008, AI_SFX_PRIORITY_1, -1);
aiNewState(actor, &beastMorphFromCultist);
actHealDude(actor, dudeInfo[51].startHealth, dudeInfo[51].startHealth);
@ -1205,7 +1205,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
{
aiPlay3DSound(actor, 361, AI_SFX_PRIORITY_0, -1);
aiPlay3DSound(actor, 1106, AI_SFX_PRIORITY_2, -1);
actor->spr.type = kDudeBurningZombieAxe;
actor->ChangeType(kDudeBurningZombieAxe);
aiNewState(actor, &zombieABurnGoto);
actHealDude(actor, dudeInfo[41].startHealth, dudeInfo[41].startHealth);
evKillActor(actor, kCallbackFXFlameLick);

View file

@ -159,7 +159,7 @@ void StompSeqCallback(int, DBloodActor* actor)
static void MorphToBeast(DBloodActor* actor)
{
actHealDude(actor, dudeInfo[51].startHealth, dudeInfo[51].startHealth);
actor->spr.type = kDudeBeast;
actor->ChangeType(kDudeBeast);
}
static void beastThinkSearch(DBloodActor* actor)

View file

@ -472,14 +472,14 @@ static void entryFStatue(DBloodActor* actor)
{
DUDEINFO* pDudeInfo = &dudeInfo[6];
actHealDude(actor, pDudeInfo->startHealth, pDudeInfo->startHealth);
actor->spr.type = kDudeGargoyleFlesh;
actor->ChangeType(kDudeGargoyleFlesh);
}
static void entrySStatue(DBloodActor* actor)
{
DUDEINFO* pDudeInfo = &dudeInfo[7];
actHealDude(actor, pDudeInfo->startHealth, pDudeInfo->startHealth);
actor->spr.type = kDudeGargoyleStone;
actor->ChangeType(kDudeGargoyleStone);
}
static void gargMoveForward(DBloodActor* actor)

View file

@ -1355,7 +1355,7 @@ void removeDudeStuff(DBloodActor* actor)
case kThingArmedProxBomb:
case kThingArmedRemoteBomb:
case kModernThingTNTProx:
actor2->spr.type = kSpriteDecoration;
actor2->ChangeType(kSpriteDecoration);
actPostSprite(actor2, kStatFree);
break;
case kModernThingEnemyLifeLeech:
@ -1398,7 +1398,7 @@ void removeLeech(DBloodActor* actLeech, bool delSprite)
if (delSprite)
{
actLeech->spr.type = kSpriteDecoration;
actLeech->ChangeType(kSpriteDecoration);
actPostSprite(actLeech, kStatFree);
}
@ -1815,7 +1815,7 @@ bool doExplosion(DBloodActor* actor, int nType)
int nSeq = 4; int nSnd = 304; const EXPLOSION* pExpl = &explodeInfo[nType];
actExplosion->spr.type = nType;
actExplosion->ChangeType(nType);
actExplosion->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
actExplosion->SetOwner(actor);
actExplosion->spr.shade = -127;
@ -1857,7 +1857,7 @@ DBloodActor* genDudeSpawn(DBloodActor* source, DBloodActor* actor, double nDist)
pos.XY() += actor->spr.Angles.Yaw.ToVector() * nDist;
}
spawned->spr.type = nType;
spawned->ChangeType(nType);
spawned->spr.Angles.Yaw = actor->spr.Angles.Yaw;
SetActor(spawned, pos);
spawned->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_BLOOD_BIT1;
@ -1955,7 +1955,8 @@ void genDudeTransform(DBloodActor* actor)
// trigger dude death before transform
trTriggerSprite(actor, kCmdOff, actor);
actor->spr.type = actor->spr.inittype = actIncarnation->spr.type;
actor->spr.inittype = actIncarnation->spr.type;
actor->ChangeType(actor->spr.inittype);
actor->spr.flags = actIncarnation->spr.flags;
actor->spr.pal = actIncarnation->spr.pal;
actor->spr.shade = actIncarnation->spr.shade;
@ -2034,7 +2035,7 @@ void genDudeTransform(DBloodActor* actor)
/*// remove the incarnation in case if non-locked
if (actIncarnation->xspr.locked == 0) {
actIncarnation->xspr.txID = actIncarnation->spr.type = 0;
actIncarnation->xspr.txID = actIncarnation->ChangeType(0);
actPostSprite(pIncarnation, kStatFree);
// or restore triggerOn and off options
} else {
@ -2485,7 +2486,7 @@ void genDudePostDeath(DBloodActor* actor, DAMAGE_TYPE damageType, int damage)
AddKill(actor, actor);
actor->spr.type = kThingBloodChunks;
actor->ChangeType(kThingBloodChunks);
actPostSprite(actor, kStatThing);
}

View file

@ -128,7 +128,7 @@ static void zombaThinkChase(DBloodActor* actor)
}
// If the zombie gets whacked while rising from the grave it never executes this change and if it isn't done here at the very latest, will just aimlessly run around.
if (!VanillaMode() && actor->spr.type == kDudeZombieAxeBuried)
actor->spr.type = kDudeZombieAxeNormal;
actor->ChangeType(kDudeZombieAxeNormal);
if (nDist <= pDudeInfo->SeeDist())
@ -253,7 +253,7 @@ static void myThinkSearch(DBloodActor* actor)
static void entryEZombie(DBloodActor* actor)
{
actor->spr.type = kDudeZombieAxeNormal;
actor->ChangeType(kDudeZombieAxeNormal);
actor->spr.flags |= 1;
}

View file

@ -152,6 +152,12 @@ public:
}
}
// this is only temporary
void ChangeType(int newtype)
{
spr.type = newtype;
}
int GetType() const
{
return spr.type;

View file

@ -95,7 +95,7 @@ void FlareBurst(DBloodActor* actor, sectortype*) // 2
spawnedactor->spr.setspritetexture(aTexIds[kTexFLAREBURST]);
spawnedactor->spr.shade = -128;
spawnedactor->spr.scale = DVector2(0.5, 0.5);
spawnedactor->spr.type = kMissileFlareAlt;
spawnedactor->ChangeType(kMissileFlareAlt);
spawnedactor->clipdist = 0.5;
spawnedactor->SetOwner(actor);
auto spAngVec = DAngle::fromBam(i << 29).ToVector().Rotated90CW() * nRadius;
@ -273,7 +273,7 @@ void Respawn(DBloodActor* actor, sectortype*) // 9
assert(actor->spr.intowner != kStatRespawn);
assert(actor->spr.intowner >= 0 && actor->spr.intowner < kMaxStatus);
ChangeActorStat(actor, actor->spr.intowner);
actor->spr.type = actor->spr.inittype;
actor->ChangeType(actor->spr.inittype);
actor->SetOwner(nullptr);
actor->spr.flags &= ~kHitagRespawn;
actor->vel.Zero();
@ -565,7 +565,7 @@ void sleeveStopBouncing(DBloodActor* actor)
break;
}
actor->spr.type = FX_51;
actor->ChangeType(FX_51);
actor->spr.scale = DVector2(0.15625, 0.15625);
}

View file

@ -166,7 +166,7 @@ DBloodActor* CFX::fxSpawnActor(FX_ID nFx, sectortype* pSector, const DVector3& p
auto actor = actSpawnSprite(pSector, pos, 1, 0);
actor->spr.type = nFx;
actor->ChangeType(nFx);
actor->spr.setspritetexture(pFX->textureID());
actor->spr.cstat |= pFX->cstat;
actor->spr.shade = pFX->shade;

View file

@ -269,7 +269,7 @@ static DBloodActor* nnExtSpawnDude(DBloodActor* sourceactor, DBloodActor* origin
SetActor(pDudeActor, pos);
pDudeActor->spr.type = nType;
pDudeActor->ChangeType(nType);
pDudeActor->spr.Angles.Yaw = angle;
pDudeActor->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL;
@ -377,7 +377,7 @@ bool nnExtEraseModernStuff(DBloodActor* actor)
case kModernConditionFalse:
case kModernSlopeChanger:
case kModernStealthRegion:
actor->spr.type = kSpriteDecoration;
actor->ChangeType(kSpriteDecoration);
erased = true;
break;
case kItemModernMapLevel:
@ -385,14 +385,14 @@ bool nnExtEraseModernStuff(DBloodActor* actor)
case kDudeModernCustomBurning:
case kModernThingTNTProx:
case kModernThingEnemyLifeLeech:
actor->spr.type = kSpriteDecoration;
actor->ChangeType(kSpriteDecoration);
ChangeActorStat(actor, kStatDecoration);
erased = true;
break;
// also erase some modernized vanilla types which was not active
case kMarkerWarpDest:
if (actor->spr.statnum == kStatMarker) break;
actor->spr.type = kSpriteDecoration;
actor->ChangeType(kSpriteDecoration);
erased = true;
break;
}
@ -2849,7 +2849,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
case kMarkerLowStack:
case kMarkerLowLink:
aLower->xspr.sysData1 = aLower->spr.type;
aLower->spr.type = kMarkerLowWater;
aLower->ChangeType(kMarkerLowWater);
break;
default:
if (pSector->portalflags != PORTAL_SECTOR_CEILING) aLower->xspr.sysData1 = kMarkerLowLink;
@ -2857,9 +2857,9 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
break;
}
}
else if (aLower->xspr.sysData1 > 0) aLower->spr.type = aLower->xspr.sysData1;
else if (pSector->portalflags != PORTAL_SECTOR_CEILING) aLower->spr.type = kMarkerLowLink;
else aLower->spr.type = kMarkerLowStack;
else if (aLower->xspr.sysData1 > 0) aLower->ChangeType(aLower->xspr.sysData1);
else if (pSector->portalflags != PORTAL_SECTOR_CEILING) aLower->ChangeType(kMarkerLowLink);
else aLower->ChangeType(kMarkerLowStack);
}
if (aUpper)
@ -2871,7 +2871,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
case kMarkerUpStack:
case kMarkerUpLink:
aUpper->xspr.sysData1 = aUpper->spr.type;
aUpper->spr.type = kMarkerUpWater;
aUpper->ChangeType(kMarkerUpWater);
break;
default:
if (pSector->portalflags != PORTAL_SECTOR_FLOOR) aUpper->xspr.sysData1 = kMarkerUpLink;
@ -2879,9 +2879,9 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
break;
}
}
else if (aUpper->xspr.sysData1 > 0) aUpper->spr.type = aUpper->xspr.sysData1;
else if (pSector->portalflags != PORTAL_SECTOR_FLOOR) aUpper->spr.type = kMarkerUpLink;
else aUpper->spr.type = kMarkerUpStack;
else if (aUpper->xspr.sysData1 > 0) aUpper->ChangeType(aUpper->xspr.sysData1);
else if (pSector->portalflags != PORTAL_SECTOR_FLOOR) aUpper->ChangeType(kMarkerUpLink);
else aUpper->ChangeType(kMarkerUpStack);
}
// search for dudes in this sector and change their underwater status
@ -6445,7 +6445,7 @@ void useRandomItemGen(DBloodActor* actor)
if ((unsigned int)iactor->spr.type == actor->xspr.dropMsg && iactor->spr.pos == actor->spr.pos)
{
gFX.fxSpawnActor((FX_ID)29, actor->sector(), actor->spr.pos);
iactor->spr.type = kSpriteDecoration;
iactor->ChangeType(kSpriteDecoration);
actPostSprite(iactor, kStatFree);
break;
}
@ -9176,7 +9176,7 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22
auto burstactor = actSpawnSprite(actor, 5);
if (!burstactor) break;
burstactor->spr.type = actor->spr.type;
burstactor->ChangeType(actor->spr.type);
burstactor->spr.shade = actor->spr.shade;
burstactor->spr.setspritetexture(actor->spr.spritetexture());

View file

@ -814,7 +814,7 @@ void playerStart(int nPlayer, int bNewLevel)
actor->spr.pos.Z -= bottom - actor->spr.pos.Z;
actor->spr.pal = 11 + (pPlayer->teamId & 3);
actor->spr.Angles.Yaw = pStartZone->angle;
actor->spr.type = kDudePlayer1 + nPlayer;
actor->ChangeType(kDudePlayer1 + nPlayer);
actor->clipdist = pDudeInfo->fClipdist();
actor->spr.flags = 15;
actor->xspr.burnTime = 0;
@ -1558,7 +1558,7 @@ void ProcessInput(PLAYER* pPlayer)
else if (seqGetStatus(pPlayer->actor) < 0)
{
if (pPlayer->actor)
pPlayer->actor->spr.type = kThingBloodChunks;
pPlayer->actor->ChangeType(kThingBloodChunks);
actPostSprite(pPlayer->actor, kStatThing);
seqSpawn(pPlayer->pDudeInfo->seqStartID + 15, pPlayer->actor, -1);
playerReset(pPlayer);