A_CheckFlag

From ZDoom Wiki
Jump to: navigation, search

A_CheckFlag (string flagname, state label [, int check_pointer])

Usage

Checks if the actor designated by the given actor pointer has the flag of this name, and if it is valid. If the pointer does not have the flag, no jump is performed.

Parameters

  • flagname: the name of the flag check for.
  • label: the state to jump to if the specified flag is set for the pointed to actor.
  • check_pointer: the actor to perform the flag check on. This is an actor pointer. Default is AAPTR_DEFAULT, which corresponds to the calling actor.

Examples

If this Imp's master is frightened, this imp will be frightened too.

ACTOR CowardImp : DoomImp
{
  States
  {
  See:
    TROO A 0 A_CheckFlag("FRIGHTENED", "RunAway", AAPTR_MASTER)
    TROO AABBCCDD 3 A_Chase
    Loop
  RunAway:
    TROO A 0 A_ChangeFlag("FRIGHTENED", TRUE)
    Goto See+2
  }  
}