CheckFlag

From ZDoom Wiki
Jump to: navigation, search

bool CheckFlag (int tid, str flag);

Usage

Checks to see if the actor with the matching tid has the specified actor flag set. If tid is 0, the check is performed on the activator of the script.

Parameters

  • tid: The tid of the actor on which to perform the flag check.
  • flag: The actor flag to check. This should be a valid flag.

Return value

The function returns true if the actor has the specified flag set, otherwise it returns false.

Examples

Checks if the actor with a tid of 1 has the FLOAT flag.

script 1 (void)
{
   if(CheckFlag(1, "FLOAT") == TRUE)
   {
       Print(s:"This enemy can fly!");
   }
   else
   {
       Print(s:"This enemy is bound by the force of gravity.");
   }
}

See also