From 16a380f82ad5ded598640f12ac498e3b7cac9d04 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Fri, 19 Sep 2014 17:27:18 -0500 Subject: [PATCH] - Added Blue Shadow's DropInventory ACS function. --- src/p_acs.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 405d60320..c5ea7031d 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4367,6 +4367,7 @@ enum EACSFunctions ACSF_ChangeActorAngle, ACSF_ChangeActorPitch, // 80 ACSF_GetArmorInfo, + ACSF_DropInventory, /* Zandronum's - these must be skipped when we reach 99! -100:ResetMap(0), @@ -5491,6 +5492,42 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) break; } + case ACSF_DropInventory: + { + const char *type = FBehavior::StaticLookupString(args[1]); + AInventory *inv; + + if (type != NULL) + { + if (args[0] == 0) + { + if (activator != NULL) + { + inv = activator->FindInventory(type); + if (inv) + { + activator->DropInventory(inv); + } + } + } + else + { + FActorIterator it(args[0]); + AActor *actor; + + while ((actor = it.Next()) != NULL) + { + inv = actor->FindInventory(type); + if (inv) + { + actor->DropInventory(inv); + } + } + } + } + break; + } + case ACSF_CheckFlag: { AActor *actor = SingleActorFromTID(args[0], activator);