mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-15 16:51:31 +00:00
- added missing NULL pointer check to ACS's CheckInventory.
This commit is contained in:
parent
fe966916d7
commit
661c2e5919
1 changed files with 6 additions and 2 deletions
|
@ -1333,9 +1333,13 @@ static int CheckInventory (AActor *activator, const char *type, bool max)
|
||||||
if (max)
|
if (max)
|
||||||
{
|
{
|
||||||
if (item)
|
if (item)
|
||||||
|
{
|
||||||
return item->MaxAmount;
|
return item->MaxAmount;
|
||||||
else
|
}
|
||||||
return ((AInventory *)GetDefaultByType (info))->MaxAmount;
|
else if (info != nullptr && info->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||||
|
{
|
||||||
|
return ((AInventory *)GetDefaultByType(info))->MaxAmount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return item ? item->Amount : 0;
|
return item ? item->Amount : 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue