mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- Added GetActorClass and GetWeapon functions to ACS.
SVN r4316 (trunk)
This commit is contained in:
parent
e9702fc43d
commit
19eb09f9f7
1 changed files with 19 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue