mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- Fixed issues with invalid GetMaxInventory calls.
This commit is contained in:
parent
44f09edf4c
commit
243030046a
1 changed files with 12 additions and 0 deletions
|
@ -1328,6 +1328,18 @@ static int CheckInventory (AActor *activator, const char *type, bool max)
|
||||||
}
|
}
|
||||||
|
|
||||||
PClassActor *info = PClass::FindActor (type);
|
PClassActor *info = PClass::FindActor (type);
|
||||||
|
|
||||||
|
if (info == NULL)
|
||||||
|
{
|
||||||
|
Printf ("ACS: I don't know what '%s' is.\n", type);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if (!info->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
||||||
|
{
|
||||||
|
Printf ("ACS: '%s' is not an inventory item.\n", type);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
AInventory *item = activator->FindInventory (info);
|
AInventory *item = activator->FindInventory (info);
|
||||||
|
|
||||||
if (max)
|
if (max)
|
||||||
|
|
Loading…
Reference in a new issue