{
LOG_TRACE("Turret ",this.netname, " used by ", actor.classname);
- this.team = actor.team;
+ if ( !(this.spawnflags & TSF_KEEPTEAM) )
+ {
+ this.team = actor.team;
- if(this.team == 0)
- this.active = ACTIVE_NOT;
+ if(this.team == 0)
+ this.active = ACTIVE_NOT;
+ else
+ this.active = ACTIVE_ACTIVE;
+ }
else
- this.active = ACTIVE_ACTIVE;
-
+ {
+ if ( this.active == ACTIVE_NOT )
+ this.active = ACTIVE_ACTIVE;
+ else
+ this.active = ACTIVE_NOT;
+ }
}
void turret_link(entity this)
_setmodel(this, tur.model);
setsize(this, tur.mins, tur.maxs);
+ if ( this.spawnflags & TSF_INACTIVE )
+ this.active = ACTIVE_NOT;
+ else
+ this.active = ACTIVE_ACTIVE;
+
this.m_id = tur.m_id;
this.classname = "turret_main";
- this.active = ACTIVE_ACTIVE;
this.effects = EF_NODRAW;
this.netname = tur.turret_name;
this.ticrate = bound(sys_frametime, this.ticrate, 60);
const int TSF_NO_PATHBREAK = 8; // don't break path to chase enemies, will still fire at them if possible
const int TSL_NO_RESPAWN = 16; // don't re-spawn
const int TSL_ROAM = 32; // roam while idle
+const int TSF_INACTIVE = 64; // start deactivated
+const int TSF_KEEPTEAM = 128; // when used, don't switch teams
// send flags
const int TNSF_UPDATE = 2;