- deal with a handful of s() uses that do not match the more common patterns.

This commit is contained in:
Christoph Oelckers 2021-12-22 20:55:58 +01:00
parent 723e22743e
commit f67e39450e
7 changed files with 17 additions and 20 deletions

View file

@ -331,7 +331,6 @@ static void ThrowThing(DBloodActor* actor, bool impact)
int dist = approxDist(dx, dy);
auto actLeech = leechIsDropped(actor);
spritetype* pLeech = actLeech? &actLeech->s() : nullptr;
XSPRITE* pXLeech = actLeech && actLeech->hasX()? &actLeech->x() : nullptr;
switch (curWeapon) {
@ -382,7 +381,7 @@ static void ThrowThing(DBloodActor* actor, bool impact)
pXSpawned->Proximity = true;
return;
case kModernThingEnemyLifeLeech:
if (pLeech != NULL) pXSpawned->health = pXLeech->health;
if (actLeech != nullptr) pXSpawned->health = pXLeech->health;
else pXSpawned->health = ((pThinkInfo->startHealth << 4) * gGameOptions.nDifficulty) >> 1;
sfxPlay3DSound(actor, 490, -1, 0);
@ -566,7 +565,6 @@ static void unicultThinkChase(DBloodActor* actor)
int weaponType = actor->genDudeExtra.weaponType;
auto actLeech = leechIsDropped(actor);
spritetype* pLeech = actLeech? &actLeech->s() : nullptr;
const VECTORDATA* meleeVector = &gVectorData[22];
if (weaponType == kGenDudeWeaponThrow)
@ -599,7 +597,7 @@ static void unicultThinkChase(DBloodActor* actor)
{
case kModernThingEnemyLifeLeech:
{
if (pLeech == NULL)
if (actLeech == nullptr)
{
aiGenDudeNewState(actor, &genDudeThrow2);
genDudeThrow2.nextState = &genDudeDodgeShortL;
@ -608,7 +606,7 @@ static void unicultThinkChase(DBloodActor* actor)
int ldist = aiFightGetTargetDist(targetactor, pDudeInfo, actLeech);
if (ldist > 3 || !cansee(pTarget->pos.X, pTarget->pos.Y, pTarget->pos.Z, pTarget->sector(),
pLeech->pos.X, pLeech->pos.Y, pLeech->pos.Z, pLeech->sector()) || actLeech->GetTarget() == nullptr)
actLeech->spr.pos.X, actLeech->spr.pos.Y, actLeech->spr.pos.Z, actLeech->spr.sector()) || actLeech->GetTarget() == nullptr)
{
aiGenDudeNewState(actor, &genDudeThrow2);
genDudeThrow2.nextState = &genDudeDodgeShortL;

View file

@ -139,10 +139,10 @@ TArray<DBloodActor*> SpawnActors(BloodSpawnSpriteDef& sprites)
auto sprt = &sprites.sprites[i];
auto actor = InsertSprite(sprt->sector(), sprt->statnum);
spawns[j++] = actor;
actor->s() = sprites.sprites[i];
if (sprites.sprext.Size()) actor->sx() = sprites.sprext[i];
else actor->sx() = {};
actor->sm() = {};
actor->spr = sprites.sprites[i];
if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i];
else actor->sprext = {};
actor->spsmooth = {};
if (sprites.sprites[i].extra > 0)
{

View file

@ -176,7 +176,7 @@ using BloodSpriteIterator = TSpriteIterator<DBloodActor>;
inline void GetActorExtents(DBloodActor* actor, int* top, int* bottom)
{
GetSpriteExtents(&actor->s(), top, bottom);
GetSpriteExtents(&actor->spr, top, bottom);
}
inline bool CheckSector(const BitArray& bits, DBloodActor* act)

View file

@ -75,10 +75,10 @@ static TArray<DExhumedActor*> spawnactors(SpawnSpriteDef& sprites)
auto sprt = &sprites.sprites[i];
auto actor = insertActor(sprt->sector(), sprt->statnum);
spawns[j++] = actor;
actor->s() = sprites.sprites[i];
if (sprites.sprext.Size()) actor->sx() = sprites.sprext[i];
else actor->sx() = {};
actor->sm() = {};
actor->spr = sprites.sprites[i];
if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i];
else actor->sprext = {};
actor->spsmooth = {};
}
return spawns;
}

View file

@ -356,10 +356,10 @@ void spawnactors(SpawnSpriteDef& sprites)
}
auto sprt = &sprites.sprites[i];
auto actor = insertActor(sprt->sector(), sprt->statnum);
actor->s() = sprites.sprites[i];
if (sprites.sprext.Size()) actor->sx() = sprites.sprext[i];
else actor->sx() = {};
actor->sm() = {};
actor->spr = sprites.sprites[i];
if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i];
else actor->sprext = {};
actor->spsmooth = {};
}
}

View file

@ -976,7 +976,7 @@ bool ActorTestSpawn(DSWActor* actor)
{
auto actorNew = insertActor(sp->sector(), STAT_DEFAULT);
int t = actorNew->spr.time; // must be preserved!
actorNew->s() = *sp;
actorNew->spr = *sp;
actorNew->spr.time = t;
change_actor_stat(actorNew, STAT_SPAWN_TRIGGER);
RESET(actorNew->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);

View file

@ -4814,7 +4814,6 @@ int ActorChooseDeath(DSWActor* actor, DSWActor* weapActor)
SPRITEp sp = &actor->s();
USERp u = actor->u();
SPRITEp wp = weapActor? &weapActor->s() : nullptr;
USERp wu = weapActor? weapActor->u() : nullptr;
if (u->Health > 0)