Beispiel #1
0
/*
===============
trigger_buildable_trigger
===============
*/
void trigger_buildable_trigger(gentity_t *self, gentity_t *activator)
{
    self->activator = activator;

    if (self->s.eFlags & EF_NODRAW)
        return;

    if (self->nextthink)
        return;  // can't retrigger until the wait is over

    if (self->s.eFlags & EF_DEAD)
    {
        if (!trigger_buildable_match(self, activator))
        {
            G_UseTargets(self, activator);
            trigger_check_wait(self);
        }
    }
    else
    {
        if (trigger_buildable_match(self, activator))
        {
            G_UseTargets(self, activator);
            trigger_check_wait(self);
        }
    }
}
Beispiel #2
0
/*
===============
trigger_equipment_trigger
===============
*/
void trigger_equipment_trigger(gentity_t *self, gentity_t *activator)
{
    // sanity check
    if (!activator || !activator->client)
        return;

    if (activator->client->ps.stats[STAT_TEAM] != TEAM_HUMANS)
        return;

    if (self->s.eFlags & EF_NODRAW)
        return;

    self->activator = activator;
    if (self->nextthink)
        return;  // can't retrigger until the wait is over

    if (self->s.eFlags & EF_DEAD)
    {
        if (!trigger_equipment_match(self, activator))
        {
            G_UseTargets(self, activator);
            trigger_check_wait(self);
        }
    }
    else
    {
        if (trigger_equipment_match(self, activator))
        {
            G_UseTargets(self, activator);
            trigger_check_wait(self);
        }
    }
}
Beispiel #3
0
// the trigger was just activated
// ent->activator should be set to the activator so it can be held through a delay
// so wait for the delay time before firing
void multi_trigger( gentity_t *ent, gentity_t *activator )
{
	ent->activator = activator;

	if ( ent->nextthink )
	{
		return; // can't retrigger until the wait is over
	}

	if ( activator && activator->client )
	{
		if ( ( ent->spawnflags & 1 ) &&
		     activator->client->ps.stats[ STAT_TEAM ] != TEAM_HUMANS )
		{
			return;
		}

		if ( ( ent->spawnflags & 2 ) &&
		     activator->client->ps.stats[ STAT_TEAM ] != TEAM_ALIENS )
		{
			return;
		}
	}

	G_UseTargets( ent, ent->activator );
	trigger_check_wait( ent );
}