From: terencehill Date: Tue, 16 Apr 2019 18:11:33 +0000 (+0200) Subject: Respawn turrets when match restarts in game types different from Assault too X-Git-Tag: xonotic-v0.8.5~1548 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b9c491efcec73f60c374133e2f4fa622aba8ad38;p=xonotic%2Fxonotic-data.pk3dir.git Respawn turrets when match restarts in game types different from Assault too --- 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);