TestMobjZ
Jump to navigation
Jump to search
Note: This feature is for ZScript only. |
bool, Actor TestMobjZ(bool quick = false)
Usage
Checks if the calling Actor is being blocked by any other Actors in its current position.
Parameters
- bool quick
- If true, stop at the first blocking Actor found. Default is false.
Return value
Returns two values:
- bool — if false, the check failed and something was blocking the caller.
- Actor — a pointer to the Actor the caller is being blocked by. If quick is false this is the tallest Actor found.
Examples
This Zombieman will print a message when it's standing on another actor:
class ZombiemanZTest : Zombieman
{
override void Tick()
{
Super.Tick();
let [passed, blocker] = TestMobjZ(false);
if (!passed && blocker)
{
Console.Printf("I am standing on %s", blocker.GetClassName());
}
}
}
See also: Tick