예제 #1
0
/*
 * QUAKED trigger_once (.5 .5 .5) ? x x TRIGGERED
 * Triggers once, then removes itself.
 *
 * You must set the key "target" to the name of another
 * object in the level that has a matching "targetname".
 *
 * If TRIGGERED, this trigger must be triggered before it is live.
 *
 * sounds
 *  1) secret
 *  2) beep beep
 *  3) large switch
 *
 * "message" string to be displayed when triggered
 */
void
SP_trigger_once(edict_t *ent)
{         
  	if (!ent)
	{
		return;
	}
 
	/* make old maps work because I messed up 
	   on flag assignments here. triggered was
	   on bit 1 when it should have been on bit 4 */
	if (ent->spawnflags & 1)
	{
		vec3_t v;

		VectorMA(ent->mins, 0.5, ent->size, v);
		ent->spawnflags &= ~1;
		ent->spawnflags |= 4;
		gi.dprintf("fixed TRIGGERED flag on %s at %s\n", ent->classname, vtos(v));
	}

	ent->wait = -1;
	SP_trigger_multiple(ent);
}
예제 #2
0
void SP_trigger_once( edict_t *ent )
{
	ent->wait = -1;
	SP_trigger_multiple( ent );
}
예제 #3
0
/*QUAKED trigger_once (.5 .5 .5) ? notouch
Variable sized trigger. Triggers once, then removes itself.  You must set the key "target" to the name of another object in the level that has a matching
"targetname".  If "health" is set, the trigger must be killed to activate.
If notouch is set, the trigger is only fired by other entities, not by touching.
if "killtarget" is set, any objects that have a matching "target" will be removed when the trigger is fired.
if "angle" is set, the trigger will only fire when someone is facing the direction of the angle.  Use "360" for an angle of 0.
sounds
1) secret
2) beep beep
3) large switch
4)
set "message" to text string
*/
void SP_trigger_once()
{
	self->wait = -1;
	SP_trigger_multiple();
}