Commit 95dce4b4 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

Rename G_HaveActor() and G_DefaultActorHealth() for clarity

The new names are G_TileHasActor() and G_DefaultActorHealthForTile().
parent 255793ff
......@@ -1365,7 +1365,7 @@ ACTOR_STATIC void G_MovePlayers(void)
otherPlayerDist = 0;
}
if (G_HaveActor(sprite[spriteNum].picnum))
if (G_TileHasActor(sprite[spriteNum].picnum))
A_Execute(spriteNum, P_GetP(pSprite), otherPlayerDist);
pPlayer->q16angvel = P_GetQ16AngleDeltaForTic(pPlayer);
......@@ -2736,7 +2736,7 @@ DETONATE:
case STEAM__STATIC:
case CEILINGSTEAM__STATIC:
case WATERBUBBLEMAKER__STATIC:
if (!G_HaveActor(sprite[spriteNum].picnum))
if (!G_TileHasActor(sprite[spriteNum].picnum))
goto next_sprite;
{
int32_t playerDist;
......@@ -2910,7 +2910,7 @@ ACTOR_STATIC void Proj_MoveCustom(int const spriteNum)
{
case PROJECTILE_HITSCAN:
{
if (!G_HaveActor(sprite[spriteNum].picnum))
if (!G_TileHasActor(sprite[spriteNum].picnum))
return;
int32_t playerDist;
int const playerNum = A_FindPlayer(pSprite, &playerDist);
......@@ -3197,7 +3197,7 @@ ACTOR_STATIC void G_MoveWeapons(void)
{
case SHOTSPARK1__STATIC:
{
if (!G_HaveActor(sprite[spriteNum].picnum))
if (!G_TileHasActor(sprite[spriteNum].picnum))
goto next_sprite;
int32_t playerDist;
int const playerNum = A_FindPlayer(pSprite, &playerDist);
......@@ -4047,7 +4047,7 @@ ACTOR_STATIC void G_MoveActors(void)
if (!WORLDTOUR)
goto next_sprite;
if (G_HaveActor(sprite[spriteNum].picnum))
if (G_TileHasActor(sprite[spriteNum].picnum))
{
int32_t playerDist;
int const playerNum = A_FindPlayer(pSprite, &playerDist);
......@@ -5374,7 +5374,7 @@ DETONATEB:
}
}
if (G_HaveActor(sprite[spriteNum].picnum))
if (G_TileHasActor(sprite[spriteNum].picnum))
{
int32_t playerDist;
int const playerNum = A_FindPlayer(pSprite, &playerDist);
......@@ -5473,7 +5473,7 @@ ACTOR_STATIC void G_MoveMisc(void) // STATNUM 5
case LASERSITE__STATIC:
#endif
{
if (!G_HaveActor(sprite[spriteNum].picnum))
if (!G_TileHasActor(sprite[spriteNum].picnum))
goto next_sprite;
int const playerNum = A_FindPlayer(pSprite, &playerDist);
A_Execute(spriteNum, playerNum, playerDist);
......@@ -5918,7 +5918,7 @@ ACTOR_STATIC void G_MoveMisc(void) // STATNUM 5
goto next_sprite;
case FIREFLYFLYINGEFFECT__STATIC:
if (WORLDTOUR && G_HaveActor(sprite[spriteNum].picnum))
if (WORLDTOUR && G_TileHasActor(sprite[spriteNum].picnum))
{
int playerDist;
int const playerNum = A_FindPlayer(pSprite, &playerDist);
......
......@@ -158,21 +158,21 @@ EDUKE32_STATIC_ASSERT(7 <= MAXTILES-MAXUSERTILES);
# include "lunatic_game.h"
#endif
static inline int32_t G_HaveActor(int spriteNum)
static inline int32_t G_TileHasActor(int const tileNum)
{
#ifdef LUNATIC
return El_HaveActor(spriteNum);
return El_HaveActor(tileNum);
#else
return g_tile[spriteNum].execPtr!=NULL;
return g_tile[tileNum].execPtr!=NULL;
#endif
}
static inline int32_t G_DefaultActorHealth(int spriteNum)
static inline int32_t G_DefaultActorHealthForTile(int const tileNum)
{
#ifdef LUNATIC
return g_elActors[spriteNum].strength;
return g_elActors[tileNum].strength;
#else
return G_HaveActor(spriteNum) ? g_tile[spriteNum].execPtr[0] : 0;
return G_TileHasActor(tileNum) ? g_tile[tileNum].execPtr[0] : 0;
#endif
}
......
......@@ -3493,7 +3493,7 @@ int A_Spawn(int spriteNum, int tileNum)
}
// implementation of the default case
if (G_HaveActor(pSprite->picnum))
if (G_TileHasActor(pSprite->picnum))
{
if (spriteNum == -1 && pSprite->lotag > ud.player_skill)
{
......@@ -4221,7 +4221,7 @@ PALONLY:
break;
}
if (G_HaveActor(pSprite->picnum))
if (G_TileHasActor(pSprite->picnum))
{
#if !defined LUNATIC
if ((unsigned)scrofs_action + ACTION_PARAM_COUNT > (unsigned)g_scriptSize)
......
......@@ -978,7 +978,7 @@ static int32_t A_GetWaterZOffset(int const spriteNum)
return 0;
// fix for flying/jumping monsters getting stuck in water
if ((AC_MOVFLAGS(pSprite, pActor) & jumptoplayer_only) || (G_HaveActor(pSprite->picnum) && A_GetVerticalVel(pActor) != 0))
if ((AC_MOVFLAGS(pSprite, pActor) & jumptoplayer_only) || (G_TileHasActor(pSprite->picnum) && A_GetVerticalVel(pActor) != 0))
return 0;
return ACTOR_ONWATER_ADDZ;
......@@ -4025,7 +4025,7 @@ badindex:
pActor->flags = 0;
pSprite->hitag = 0;
if (G_HaveActor(pSprite->picnum))
if (G_TileHasActor(pSprite->picnum))
{
auto actorptr = g_tile[pSprite->picnum].execPtr;
// offsets
......
......@@ -912,7 +912,7 @@ static void Net_CopyActorFromNet(const netactor_t* netActor, actor_t *gameActor)
bool aiIDChanged = (gameActor->t_data[5] != netActor->t_data_5);
// If the sprite is a CON sprite, don't overwrite AC_Action_Count
bool isActor = G_HaveActor(netActor->spr_picnum);
bool isActor = G_TileHasActor(netActor->spr_picnum);
// Fixes ambient sound infinite sound replay glitch (stand in the outdoor area of E1L1, the "airplane noise" will get very loud and loop endlessly.
bool isSoundActor = (DYNAMICTILEMAP(netActor->picnum) == MUSICANDSFX);
......
......@@ -1202,14 +1202,14 @@ static int32_t A_ShootHardcoded(int spriteNum, int projecTile, int shootAng, vec
if (playerNum >= 0)
{
spawnedSprite = Proj_InsertShotspark(&hitData, spriteNum, projecTile, 10, shootAng, G_DefaultActorHealth(projecTile) + (krand() % 6));
spawnedSprite = Proj_InsertShotspark(&hitData, spriteNum, projecTile, 10, shootAng, G_DefaultActorHealthForTile(projecTile) + (krand() % 6));
if (P_PostFireHitscan(playerNum, spawnedSprite, &hitData, spriteNum, projecTile, Zvel, -SMALLSMOKE, BULLETHOLE, SHOTSPARK1, 0) < 0)
return -1;
}
else
{
spawnedSprite = A_PostFireHitscan(&hitData, spriteNum, projecTile, Zvel, shootAng, G_DefaultActorHealth(projecTile), -SMALLSMOKE,
spawnedSprite = A_PostFireHitscan(&hitData, spriteNum, projecTile, Zvel, shootAng, G_DefaultActorHealthForTile(projecTile), -SMALLSMOKE,
SHOTSPARK1);
}
......
......@@ -2068,7 +2068,7 @@ void A_DamageObject_Duke3D(int spriteNum, int const dmgSrc)
case FUELPOD__STATIC:
case SOLARPANNEL__STATIC:
case ANTENNA__STATIC:
if (sprite[dmgSrc].extra != G_DefaultActorHealth(SHOTSPARK1))
if (sprite[dmgSrc].extra != G_DefaultActorHealthForTile(SHOTSPARK1))
{
for (bssize_t j=15; j>0; j--)
A_InsertSprite(SECT(spriteNum),SX(spriteNum),SY(spriteNum),sector[SECT(spriteNum)].floorz-ZOFFSET4-(j<<9),SCRAP1+(krand()&15),-8,64,64,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment