From f67e39450eef42f273dc9ae5142c5e3ca70cfce1 Mon Sep 17 00:00:00 2001
From: Christoph Oelckers <coelckers@users.noreply.github.com>
Date: Wed, 22 Dec 2021 20:55:58 +0100
Subject: [PATCH] - deal with a handful of s() uses that do not match the more
 common patterns.

---
 source/games/blood/src/aiunicult.cpp | 8 +++-----
 source/games/blood/src/blood.cpp     | 8 ++++----
 source/games/blood/src/bloodactor.h  | 2 +-
 source/games/exhumed/src/init.cpp    | 8 ++++----
 source/games/sw/src/game.cpp         | 8 ++++----
 source/games/sw/src/sprite.cpp       | 2 +-
 source/games/sw/src/weapon.cpp       | 1 -
 7 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp
index a867541ec..cc41c0b25 100644
--- a/source/games/blood/src/aiunicult.cpp
+++ b/source/games/blood/src/aiunicult.cpp
@@ -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;
diff --git a/source/games/blood/src/blood.cpp b/source/games/blood/src/blood.cpp
index 64fe63edf..0a250835f 100644
--- a/source/games/blood/src/blood.cpp
+++ b/source/games/blood/src/blood.cpp
@@ -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)
 		{
diff --git a/source/games/blood/src/bloodactor.h b/source/games/blood/src/bloodactor.h
index 174ef74e0..7b415277d 100644
--- a/source/games/blood/src/bloodactor.h
+++ b/source/games/blood/src/bloodactor.h
@@ -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)
diff --git a/source/games/exhumed/src/init.cpp b/source/games/exhumed/src/init.cpp
index 43056f627..142419ca5 100644
--- a/source/games/exhumed/src/init.cpp
+++ b/source/games/exhumed/src/init.cpp
@@ -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;
 }
diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp
index e515f3a7e..ace15bc54 100644
--- a/source/games/sw/src/game.cpp
+++ b/source/games/sw/src/game.cpp
@@ -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 = {};
     }
 }
 
diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp
index 03555d194..9f403744a 100644
--- a/source/games/sw/src/sprite.cpp
+++ b/source/games/sw/src/sprite.cpp
@@ -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);
diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp
index 6f4873d6a..837fb9067 100644
--- a/source/games/sw/src/weapon.cpp
+++ b/source/games/sw/src/weapon.cpp
@@ -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)