mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-31 04:50:48 +00:00
- fixed: Classes inherited from PowerScanner didn't work anymore.
SVN r2368 (trunk)
This commit is contained in:
parent
ec44397881
commit
b2cef54d72
3 changed files with 15 additions and 5 deletions
|
@ -646,7 +646,7 @@ public:
|
|||
bool CheckLocalView (int playernum) const;
|
||||
|
||||
// Finds the first item of a particular type.
|
||||
AInventory *FindInventory (const PClass *type);
|
||||
AInventory *FindInventory (const PClass *type, bool subclass = false);
|
||||
AInventory *FindInventory (FName type);
|
||||
template<class T> T *FindInventory ()
|
||||
{
|
||||
|
|
|
@ -2127,7 +2127,7 @@ void AM_Drawer ()
|
|||
return;
|
||||
|
||||
bool allmap = (level.flags2 & LEVEL2_ALLMAP) != 0;
|
||||
bool allthings = allmap && players[consoleplayer].mo->FindInventory<APowerScanner>() != NULL;
|
||||
bool allthings = allmap && players[consoleplayer].mo->FindInventory(RUNTIME_CLASS(APowerScanner), true) != NULL;
|
||||
|
||||
AM_initColors (viewactive);
|
||||
|
||||
|
|
|
@ -772,7 +772,7 @@ AInventory *AActor::DropInventory (AInventory *item)
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
AInventory *AActor::FindInventory (const PClass *type)
|
||||
AInventory *AActor::FindInventory (const PClass *type, bool subclass)
|
||||
{
|
||||
AInventory *item;
|
||||
|
||||
|
@ -781,9 +781,19 @@ AInventory *AActor::FindInventory (const PClass *type)
|
|||
assert (type->ActorInfo != NULL);
|
||||
for (item = Inventory; item != NULL; item = item->Inventory)
|
||||
{
|
||||
if (item->GetClass() == type)
|
||||
if (!subclass)
|
||||
{
|
||||
break;
|
||||
if (item->GetClass() == type)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item->IsKindOf(type))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return item;
|
||||
|
|
Loading…
Reference in a new issue