From 19eb09f9f7adf9c36aab2ec2a01ec99b51fa5517 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 1 Jun 2013 17:17:15 +0000 Subject: [PATCH] - Added GetActorClass and GetWeapon functions to ACS. SVN r4316 (trunk) --- src/p_acs.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index cb7da1a53..bd1f18484 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4132,6 +4132,8 @@ enum EACSFunctions ACSF_StrLeft, ACSF_StrRight, ACSF_StrMid, + ACSF_GetActorClass, + ACSF_GetWeapon, // ZDaemon ACSF_GetTeamScore = 19620, // (int team) @@ -4653,6 +4655,12 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args) return a == NULL ? false : a->GetClass()->TypeName == FName(FBehavior::StaticLookupString(args[1])); } + case ACSF_GetActorClass: + { + AActor *a = SingleActorFromTID(args[0], activator); + return GlobalACSStrings.AddString(a == NULL ? "None" : a->GetClass()->TypeName.GetChars()); + } + case ACSF_SoundSequenceOnActor: { const char *seqname = FBehavior::StaticLookupString(args[1]); @@ -5025,6 +5033,17 @@ doplaysound: if (!looping) } break; + case ACSF_GetWeapon: + if (activator == NULL || activator->player == NULL || // Non-players do not have weapons + activator->player->ReadyWeapon == NULL) + { + return GlobalACSStrings.AddString("None"); + } + else + { + return GlobalACSStrings.AddString(activator->player->ReadyWeapon->GetClass()->TypeName.GetChars()); + } + default: break; }