A_LinedefExecute is an action that executes a linedef executor. The calling sector is the one the actor is in when the action is performed. The tag of the executor's trigger linedef is determined by Var1. Additionally if Var2 is set, the actor's angle (in degrees) can be added on to this tag, multiplied by the value of Var2.
Note that negative numbers can also be used for Var1; tag numbers 32768 to 65536 displayed in map editors are in actual fact tag numbers -32768 to -1, though this action allows use of either version for ease and compatability.
Code – A_LinedefExecute
// Function: A_LinedefExecute
// Description: Object's location is used to set the calling sector. The tag used is var1. Optionally, if var2 is set, the actor's angle (multiplied by var2) is added to the tag number as well.
// var1 = tag
// var2 = add angle to tag (optional)
void A_LinedefExecute(mobj_t *actor)
INT32 locvar1 = var1;
INT32 locvar2 = var2;
if (LUA_CallAction("A_LinedefExecute", actor))
tagnum = locvar1;
// state numbers option is no more, custom states cannot be guaranteed to stay the same number anymore, now that they can be defined by names instead
tagnum += locvar2*(AngleFixed(actor->angle)>>FRACBITS);
CONS_Debug(DBG_GAMELOGIC, "A_LinedefExecute: Running mobjtype %d's sector with tag %d\n", actor->type, tagnum);
// tag 32768 displayed in map editors is actually tag -32768, tag 32769 is -32767, 65535 is -1 etc.
P_LinedefExecute((INT16)tagnum, actor, actor->subsector->sector);