From 243030046a2b3e0f52f27fa591a7d300f457bb79 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Wed, 18 May 2016 09:37:00 +0200 Subject: [PATCH] - Fixed issues with invalid GetMaxInventory calls. --- src/p_acs.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index d66d0f8f8..2de959be6 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -1328,6 +1328,18 @@ static int CheckInventory (AActor *activator, const char *type, bool max) } 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); if (max)