Rename G_HaveActor() and G_DefaultActorHealth() for clarity

The new names are G_TileHasActor() and G_DefaultActorHealthForTile().

# Conflicts:
#	source/duke3d/src/duke3d.h
This commit is contained in:
Richard C. Gobeille 2020-04-04 23:40:38 -07:00 committed by Christoph Oelckers
parent c8f15f8e4b
commit 01bb5491af
7 changed files with 20 additions and 20 deletions

View file

@ -1371,7 +1371,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);
@ -2737,7 +2737,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;
@ -2911,7 +2911,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);
@ -3198,7 +3198,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);
@ -4048,7 +4048,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);
@ -5375,7 +5375,7 @@ DETONATEB:
}
}
if (G_HaveActor(sprite[spriteNum].picnum))
if (G_TileHasActor(sprite[spriteNum].picnum))
{
int32_t playerDist;
int const playerNum = A_FindPlayer(pSprite, &playerDist);
@ -5474,7 +5474,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);
@ -5919,7 +5919,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);

View file

@ -132,14 +132,14 @@ EDUKE32_STATIC_ASSERT(7 <= MAXTILES-MAXUSERTILES);
BEGIN_DUKE_NS
static inline int32_t G_HaveActor(int spriteNum)
static inline int32_t G_TileHasActor(int const tileNum)
{
return g_tile[spriteNum].execPtr!=NULL;
return g_tile[tileNum].execPtr!=NULL;
}
static inline int32_t G_DefaultActorHealth(int spriteNum)
static inline int32_t G_DefaultActorHealthForTile(int const tileNum)
{
return G_HaveActor(spriteNum) ? g_tile[spriteNum].execPtr[0] : 0;
return G_TileHasActor(tileNum) ? g_tile[tileNum].execPtr[0] : 0;
}

View file

@ -3171,7 +3171,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)
{
@ -3880,7 +3880,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)

View file

@ -990,7 +990,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;
@ -3954,7 +3954,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

View file

@ -918,7 +918,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);

View file

@ -1210,14 +1210,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);
}

View file

@ -2072,7 +2072,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,