void target_relay_act( gentity_t *self, gentity_t*, gentity_t *activator ) { if (!self->enabled) return; if ( ( self->spawnflags & 1 ) && activator && activator->client && activator->client->pers.team != TEAM_HUMANS ) { return; } if ( ( self->spawnflags & 2 ) && activator && activator->client && activator->client->pers.team != TEAM_ALIENS ) { return; } if ( self->spawnflags & 4 ) { G_FireEntityRandomly( self, activator ); return; } if ( !self->config.wait.time ) { G_FireEntity( self, activator ); } else { self->nextthink = VariatedLevelTime( self->config.wait ); self->think = think_fireDelayed; self->activator = activator; } }
void ctrl_relay_act( gentity_t *self, gentity_t*, gentity_t *activator ) { if (!self->enabled) return; if ( !self->config.wait.time ) { G_EventFireEntity( self, activator, ON_ACT ); } else { self->nextthink = VariatedLevelTime( self->config.wait ); self->think = think_fireOnActDelayed; self->activator = activator; } }
/** * check delayed variable and either call an entity act() directly or delay its execution */ void G_HandleActCall( gentity_t *entity, gentityCall_t *call ) { variatingTime_t delay = {0, 0}; ASSERT(call != nullptr); entity->callIn = *call; G_ResetTimeField(&delay, entity->config.delay, entity->eclass->config.delay, delay ); if(delay.time) { entity->nextAct = VariatedLevelTime( delay ); } else /* no time and variance set means, we can call it directly instead of waiting for the next frame */ { G_ExecuteAct( entity, call ); } }
void env_afx_push_touch( gentity_t *self, gentity_t *activator, trace_t* ) { //only triggered by clients if ( !activator || !activator->client ) { return; } if ( activator->client->ps.pm_type != PM_NORMAL ) { return; } if ( self->nextthink > level.time ) { return; } self->nextthink = VariatedLevelTime( self->config.wait ); VectorCopy( self->s.origin2, activator->client->ps.velocity ); }