]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/sv_turrets.qc
Merge branch 'terencehill/dumpturrets' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / sv_turrets.qc
index 820221d434d6ad22ed31ae151e1e40ffe60101aa..18197c078373f749c8d3127cc10f68396600889a 100644 (file)
@@ -1266,6 +1266,11 @@ void turret_findtarget(entity this)
        this.idle_aim = this.tur_head.angles + angleofs(this.tur_head, targ);
 }
 
+void turret_reset(entity this)
+{
+       turret_respawn(this);
+}
+
 bool turret_initialize(entity this, Turret tur)
 {
        if(!autocvar_g_turrets)
@@ -1341,7 +1346,6 @@ bool turret_initialize(entity this, Turret tur)
        setsize(this, tur.m_mins, tur.m_maxs);
 
        this.m_id                                       = tur.m_id;
-       this.classname                          = "turret_main";
        this.active                                     = ACTIVE_ACTIVE;
        this.effects                            = EF_NODRAW;
        this.netname                            = tur.turret_name;
@@ -1360,8 +1364,8 @@ bool turret_initialize(entity this, Turret tur)
        this.event_heal                         = turret_heal;
        this.use                                        = turret_use;
        this.bot_attack                         = true;
-       this.nextthink                          = time + 1;
-       this.nextthink                     += turret_count * sys_frametime;
+       this.nextthink                          = time + 1 + turret_count * sys_frametime;
+       this.reset                                      = turret_reset;
 
        this.tur_head = new(turret_head);
        _setmodel(this.tur_head, tur.head_model);