A_CheckBuddy is an action that checks if the actor's "buddy" Object has at least one health point left – Var1 determines whether the "buddy" Object is the actor's target (0) or the actor's tracer (1). If the chosen Object does not have any health left, or does not exist, the actor is removed from the map. In SRB2, this action is used by the Pointy's spikeballs to make sure they disappear when the Pointy itself (their target) is destroyed.
Code – A_CheckBuddy
// Function: A_CheckBuddy
// Description: Checks if target/tracer exists/has health. If not, the object removes itself.
// 0 = target
// 1 = tracer
// var2 = unused
void A_CheckBuddy(mobj_t *actor)
INT32 locvar1 = var1;
if (LUA_CallAction("A_CheckBuddy", actor))
if (locvar1 && (!actor->tracer || actor->tracer->health <= 0))
else if (!locvar1 && (!actor->target || actor->target->health <= 0))