mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
- started replacing direct references to class AInventory.
The easiest part was the type checks which could be changed to the name variant with a global search and replace.
This commit is contained in:
parent
6fd3bea38c
commit
bfcd714186
14 changed files with 19 additions and 19 deletions
|
@ -903,12 +903,12 @@ static bool IsActorAMonster(AActor *mo)
|
|||
|
||||
static bool IsActorAnItem(AActor *mo)
|
||||
{
|
||||
return mo->IsKindOf(RUNTIME_CLASS(AInventory)) && mo->flags&MF_SPECIAL;
|
||||
return mo->IsKindOf(NAME_Inventory) && mo->flags&MF_SPECIAL;
|
||||
}
|
||||
|
||||
static bool IsActorACountItem(AActor *mo)
|
||||
{
|
||||
return mo->IsKindOf(RUNTIME_CLASS(AInventory)) && mo->flags&MF_SPECIAL && mo->flags&MF_COUNTITEM;
|
||||
return mo->IsKindOf(NAME_Inventory) && mo->flags&MF_SPECIAL && mo->flags&MF_COUNTITEM;
|
||||
}
|
||||
|
||||
// [SP] for all actors
|
||||
|
|
|
@ -3054,7 +3054,7 @@ void FinishDehPatch ()
|
|||
FStateDefinitions statedef;
|
||||
statedef.MakeStateDefines(type);
|
||||
|
||||
if (!type->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
if (!type->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
// If this is a hacked non-inventory item we must also copy AInventory's special states
|
||||
statedef.AddStateDefines(RUNTIME_CLASS(AInventory)->GetStateLabels());
|
||||
|
|
|
@ -3658,7 +3658,7 @@ void FParser::SF_ThingCount(void)
|
|||
again:
|
||||
TThinkerIterator<AActor> it;
|
||||
|
||||
if (t_argc<2 || intvalue(t_argv[1])==0 || pClass->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
if (t_argc<2 || intvalue(t_argv[1])==0 || pClass->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
while ((mo=it.Next()))
|
||||
{
|
||||
|
|
|
@ -178,7 +178,7 @@ static void AddOneKey(Keygroup *keygroup, PClassActor *mi, FScanner &sc)
|
|||
if (mi)
|
||||
{
|
||||
// Any inventory item can be used to unlock a door
|
||||
if (mi->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
if (mi->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
OneKey k = {mi,1};
|
||||
keygroup->anykeylist.Push (k);
|
||||
|
|
|
@ -452,7 +452,7 @@ DEFINE_ACTION_FUNCTION(ASpecialSpot, A_SpawnSingleItem)
|
|||
{
|
||||
spawned->flags &= ~MF_DROPPED;
|
||||
}
|
||||
if (spawned->IsKindOf(RUNTIME_CLASS(AInventory)))
|
||||
if (spawned->IsKindOf(NAME_Inventory))
|
||||
{
|
||||
static_cast<AInventory*>(spawned)->SpawnPointClass = self->GetClass();
|
||||
}
|
||||
|
|
|
@ -555,7 +555,7 @@ void GLSprite::SplitSprite(HWDrawInfo *di, sector_t * frontsector, bool transluc
|
|||
void GLSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingpos, float spriteheight)
|
||||
{
|
||||
const float NO_VAL = 100000000.0f;
|
||||
bool clipthing = (thing->player || thing->flags3&MF3_ISMONSTER || thing->IsKindOf(RUNTIME_CLASS(AInventory))) && (thing->flags&MF_ICECORPSE || !(thing->flags&MF_CORPSE));
|
||||
bool clipthing = (thing->player || thing->flags3&MF3_ISMONSTER || thing->IsKindOf(NAME_Inventory)) && (thing->flags&MF_ICECORPSE || !(thing->flags&MF_CORPSE));
|
||||
bool smarterclip = !clipthing && gl_spriteclip == 3;
|
||||
if (clipthing || gl_spriteclip > 1)
|
||||
{
|
||||
|
@ -932,7 +932,7 @@ void GLSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
|
|||
|
||||
if (di->isNightvision())
|
||||
{
|
||||
if ((thing->IsKindOf(RUNTIME_CLASS(AInventory)) || thing->flags3&MF3_ISMONSTER || thing->flags&MF_MISSILE || thing->flags&MF_CORPSE))
|
||||
if ((thing->IsKindOf(NAME_Inventory) || thing->flags3&MF3_ISMONSTER || thing->flags&MF_MISSILE || thing->flags&MF_CORPSE))
|
||||
{
|
||||
RenderStyle.Flags |= STYLEF_InvertSource;
|
||||
}
|
||||
|
|
|
@ -339,7 +339,7 @@ static void LoadAltHudStuff()
|
|||
{
|
||||
Printf("Unknown item class '%s' in ALTHUDCF\n", sc.String);
|
||||
}
|
||||
else if (!ti->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
else if (!ti->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
Printf("Invalid item class '%s' in ALTHUDCF\n", sc.String);
|
||||
ti = NULL;
|
||||
|
|
|
@ -1831,7 +1831,7 @@ static int CheckInventory (AActor *activator, const char *type, bool max)
|
|||
DPrintf (DMSG_ERROR, "ACS: '%s': Unknown actor class.\n", type);
|
||||
return 0;
|
||||
}
|
||||
else if (!info->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
else if (!info->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
DPrintf(DMSG_ERROR, "ACS: '%s' is not an inventory item.\n", type);
|
||||
return 0;
|
||||
|
@ -1845,7 +1845,7 @@ static int CheckInventory (AActor *activator, const char *type, bool max)
|
|||
{
|
||||
return item->MaxAmount;
|
||||
}
|
||||
else if (info != nullptr && info->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
else if (info != nullptr && info->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
return ((AInventory *)GetDefaultByType(info))->MaxAmount;
|
||||
}
|
||||
|
|
|
@ -4047,7 +4047,7 @@ static bool DoRadiusGive(AActor *self, AActor *thing, PClassActor *item, int amo
|
|||
return false;
|
||||
doPass = true;
|
||||
}
|
||||
else if (((flags & RGF_ITEMS) && thing->IsKindOf(RUNTIME_CLASS(AInventory))) ||
|
||||
else if (((flags & RGF_ITEMS) && thing->IsKindOf(NAME_Inventory)) ||
|
||||
((flags & RGF_CORPSES) && thing->flags & MF_CORPSE) ||
|
||||
((flags & RGF_KILLED) && thing->flags6 & MF6_KILLED))
|
||||
{
|
||||
|
|
|
@ -373,7 +373,7 @@ static FStrifeDialogueNode *ReadRetailNode (FileReader &lump, uint32_t &prevSpea
|
|||
for (j = 0; j < 3; ++j)
|
||||
{
|
||||
auto inv = GetStrifeType(speech.ItemCheck[j]);
|
||||
if (!inv->IsDescendantOf(RUNTIME_CLASS(AInventory))) inv = nullptr;
|
||||
if (!inv->IsDescendantOf(NAME_Inventory)) inv = nullptr;
|
||||
node->ItemCheck[j].Item = inv;
|
||||
node->ItemCheck[j].Amount = -1;
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ static void ParseReplies (FStrifeDialogueReply **replyptr, Response *responses)
|
|||
for (k = 0; k < 3; ++k)
|
||||
{
|
||||
auto inv = GetStrifeType(rsp->Item[k]);
|
||||
if (!inv->IsDescendantOf(RUNTIME_CLASS(AInventory))) inv = nullptr;
|
||||
if (!inv->IsDescendantOf(NAME_Inventory)) inv = nullptr;
|
||||
reply->ItemCheck[k].Item = inv;
|
||||
reply->ItemCheck[k].Amount = rsp->Count[k];
|
||||
}
|
||||
|
@ -951,7 +951,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
|
|||
takestuff = true;
|
||||
if (reply->GiveType != NULL)
|
||||
{
|
||||
if (reply->GiveType->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||
if (reply->GiveType->IsDescendantOf(NAME_Inventory))
|
||||
{
|
||||
if (reply->GiveType->IsDescendantOf(NAME_Weapon))
|
||||
{
|
||||
|
|
|
@ -543,7 +543,7 @@ bool P_TeleportMove(AActor* thing, const DVector3 &pos, bool telefrag, bool modi
|
|||
continue;
|
||||
|
||||
// Don't let players and monsters block item teleports (all other actor types will still block.)
|
||||
if (thing->IsKindOf(RUNTIME_CLASS(AInventory)) && !(thing->flags & MF_SOLID) && ((th->flags3 & MF3_ISMONSTER) || th->player != nullptr))
|
||||
if (thing->IsKindOf(NAME_Inventory) && !(thing->flags & MF_SOLID) && ((th->flags3 & MF3_ISMONSTER) || th->player != nullptr))
|
||||
continue;
|
||||
|
||||
// monsters don't stomp things except on boss level
|
||||
|
|
|
@ -625,7 +625,7 @@ DEFINE_ACTION_FUNCTION(AActor, InStateSequence)
|
|||
bool AActor::IsMapActor()
|
||||
{
|
||||
// [SP] Don't remove owned inventory objects.
|
||||
return (!IsKindOf(RUNTIME_CLASS(AInventory)) || static_cast<AInventory *>(this)->Owner == nullptr);
|
||||
return (!IsKindOf(NAME_Inventory) || static_cast<AInventory *>(this)->Owner == nullptr);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -75,7 +75,7 @@ class USDFParser : public UDMFParserBase
|
|||
PClassActor *CheckInventoryActorType(const char *key)
|
||||
{
|
||||
PClassActor* const type = CheckActorType(key);
|
||||
return nullptr != type && type->IsDescendantOf(RUNTIME_CLASS(AInventory)) ? type : nullptr;
|
||||
return nullptr != type && type->IsDescendantOf(NAME_Inventory) ? type : nullptr;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -225,7 +225,7 @@ double RenderPolySprite::PerformSpriteClipAdjustment(AActor *thing, const DVecto
|
|||
if (!(spriteheight > 0 && spriteclip > 0 && spritetype == RF_FACESPRITE))
|
||||
return z2;
|
||||
|
||||
bool clipthing = (thing->player || thing->flags3&MF3_ISMONSTER || thing->IsKindOf(RUNTIME_CLASS(AInventory))) && (thing->flags&MF_ICECORPSE || !(thing->flags&MF_CORPSE));
|
||||
bool clipthing = (thing->player || thing->flags3&MF3_ISMONSTER || thing->IsKindOf(NAME_Inventory)) && (thing->flags&MF_ICECORPSE || !(thing->flags&MF_CORPSE));
|
||||
bool smarterclip = !clipthing && spriteclip == 3;
|
||||
if (clipthing || spriteclip > 1)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue