mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 04:22:34 +00:00
Add CheckActorState ACS function
bool CheckActorState(int tid, str statename, bool exact = false); - Same parameter order as SetActorState - Returns true if actor has the state; else returns false
This commit is contained in:
parent
5ff0abe568
commit
df4a8e38c5
1 changed files with 13 additions and 2 deletions
|
@ -4438,8 +4438,7 @@ enum EACSFunctions
|
||||||
ACSF_SpawnParticle,
|
ACSF_SpawnParticle,
|
||||||
ACSF_SetMusicVolume,
|
ACSF_SetMusicVolume,
|
||||||
ACSF_CheckProximity,
|
ACSF_CheckProximity,
|
||||||
// 1 more left...
|
ACSF_CheckActorState, // 99
|
||||||
|
|
||||||
/* Zandronum's - these must be skipped when we reach 99!
|
/* Zandronum's - these must be skipped when we reach 99!
|
||||||
-100:ResetMap(0),
|
-100:ResetMap(0),
|
||||||
-101 : PlayerIsSpectator(1),
|
-101 : PlayerIsSpectator(1),
|
||||||
|
@ -6017,6 +6016,18 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
||||||
return P_Thing_CheckProximity(actor, classname, distance, count, flags, ptr);
|
return P_Thing_CheckProximity(actor, classname, distance, count, flags, ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ACSF_CheckActorState:
|
||||||
|
{
|
||||||
|
actor = SingleActorFromTID(args[0], activator);
|
||||||
|
const char *statename = FBehavior::StaticLookupString(args[1]);
|
||||||
|
bool exact = (argCount > 2) ? !!args[2] : false;
|
||||||
|
if (actor && statename)
|
||||||
|
{
|
||||||
|
return (actor->GetClass()->FindStateByString(statename, exact) != nullptr);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue