mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
Added GetActorPowerupTics ACS function
This commit is contained in:
parent
940794929c
commit
ca93e04de3
1 changed files with 22 additions and 0 deletions
|
@ -4260,6 +4260,7 @@ enum EACSFunctions
|
|||
ACSF_CheckFlag,
|
||||
ACSF_SetLineActivation,
|
||||
ACSF_GetLineActivation,
|
||||
ACSF_GetActorPowerupTics,
|
||||
|
||||
// ZDaemon
|
||||
ACSF_GetTeamScore = 19620, // (int team)
|
||||
|
@ -5325,6 +5326,27 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
}
|
||||
break;
|
||||
|
||||
case ACSF_GetActorPowerupTics:
|
||||
if (argCount >= 2)
|
||||
{
|
||||
const PClass *powerupclass = PClass::FindClass(FBehavior::StaticLookupString(args[1]));
|
||||
if (powerupclass == NULL || !RUNTIME_CLASS(APowerup)->IsAncestorOf(powerupclass))
|
||||
{
|
||||
Printf("'%s' is not a type of Powerup.\n", FBehavior::StaticLookupString(args[1]));
|
||||
return 0;
|
||||
}
|
||||
|
||||
AActor *actor = SingleActorFromTID(args[0], activator);
|
||||
if (actor != NULL)
|
||||
{
|
||||
APowerup* powerup = (APowerup*)actor->FindInventory(powerupclass);
|
||||
if (powerup != NULL)
|
||||
return powerup->EffectTics;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue