]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Respawn turrets when match restarts in game types different from Assault too
authorterencehill <piuntn@gmail.com>
Tue, 16 Apr 2019 18:11:33 +0000 (20:11 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 16 Apr 2019 18:11:33 +0000 (20:11 +0200)
qcsrc/common/turrets/sv_turrets.qc

index 50a7691685f9ca7e51e4653505ff96f5ace14dd2..e2c30109f814e4efe08af4d4f7d87cc2f2300f77 100644 (file)
@@ -1288,6 +1288,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)
@@ -1381,8 +1386,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);