A_BubbleCheck is an action that checks if the actor is underwater and sets it to be invisible if it is not. This is done with the Object flag
MF2_DONTDRAW, which, if enabled, prevents the game from drawing the Object's sprite. If the actor is underwater, the flag is removed, making the Object visible; if the actor is not underwater, it is added, making the Object invisible. In SRB2, this action is used by the Air Bubble Patch.
Code – A_BubbleCheck
// Function: A_BubbleCheck
// Description: Checks if a bubble should be drawn or not. Bubbles are not drawn above water.
// var1 = unused
// var2 = unused
void A_BubbleCheck(mobj_t *actor)
if (LUA_CallAction("A_BubbleCheck", actor))
if (actor->eflags & MFE_UNDERWATER)
actor->flags2 &= ~MF2_DONTDRAW; // underwater so draw
actor->flags2 |= MF2_DONTDRAW; // above water so don't draw