Пример #1
0
static int CmdLSpec1(void)
{
    int special;

    special = LONG(*PCodePtr);
    ++PCodePtr;
    SpecArgs[0] = Pop();
    P_ExecuteLineSpecial(special, SpecArgs, ACScript->line,
                         ACScript->side, ACScript->activator);
    return SCRIPT_CONTINUE;
}
Пример #2
0
boolean P_ActivateLine(line_t *line, mobj_t *mo, int side, int activationType)
{
	int     lineActivation;
	boolean repeat;
	boolean buttonSuccess;

	lineActivation = GET_SPAC(line->flags);
	if(lineActivation != activationType)
	{
		return false;
	}
	if(!mo->player && !(mo->flags & MF_MISSILE))
	{
		if(lineActivation != SPAC_MCROSS)
		{						// currently, monsters can only activate the MCROSS activation type
			return false;
		}
		if(line->flags & ML_SECRET)
			return false;		// never open secret doors
	}
	repeat = line->flags & ML_REPEAT_SPECIAL;
	buttonSuccess = false;

	buttonSuccess =
		P_ExecuteLineSpecial(line->special, &line->arg1, line, side, mo);
	if(!repeat && buttonSuccess)
	{							// clear the special on non-retriggerable lines
		line->special = 0;
	}
	if((lineActivation == SPAC_USE || lineActivation == SPAC_IMPACT) &&
	   buttonSuccess)
	{
		P_ChangeSwitchTexture(line, repeat);
	}
	return true;
}