From b9c491efcec73f60c374133e2f4fa622aba8ad38 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 16 Apr 2019 20:11:33 +0200 Subject: [PATCH] Respawn turrets when match restarts in game types different from Assault too --- qcsrc/common/turrets/sv_turrets.qc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index 50a769168..e2c30109f 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -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); -- 2.39.2