A_CheckHeight is an action that calls a state depending on the absolute height difference between the actor and its target or tracer. The lower 16 bits of Var1 determines the maximum height difference, measured in fracunits, between the two Objects to allow the state to be called with – i.e. if the height difference is less than or equal to the lower 16 bits of Var1, the state is called. The upper 16 bits of Var1 determines whether the actor's target (0) or tracer (1) is used. Var2 determines the state to call when this action is successful; see List of states for a full list. If the chosen Object does not exist, this action will do nothing.
This action originates from the v2.0 modification SRB2Morphed and was added to SRB2 itself in v2.1.
Code – A_CheckHeight
// Function: A_CheckHeight
// Description: Calls a state if the object and it's target have a height offset <= var1 compared to each other.
// lower 16 bits = height offset
// upper 16 bits = 0 - target, 1 - tracer
// var2 = state number
void A_CheckHeight(mobj_t *actor)
INT32 locvar1 = var1;
INT32 locvar2 = var2;
if (LUA_CallAction("A_CheckHeight", actor))
if ((!(locvar1 >> 16) && !actor->target) || ((locvar1 >> 16) && !actor->tracer))
if (!(locvar1 >> 16)) // target
height = abs(actor->target->z - actor->z);
else // tracer
height = abs(actor->tracer->z - actor->z);
if (height <= FixedMul((locvar1 & 65535)*FRACUNIT, actor->scale))