From 54d857232109b30cbe29d1bfb1401e7413ff25f7 Mon Sep 17 00:00:00 2001 From: Steam Deck User Date: Wed, 28 Dec 2022 19:32:21 -0500 Subject: [PATCH] Server: Misc. Co-Op fixes --- source/server/ai/ai_core.qc | 2 +- source/server/damage.qc | 2 +- source/server/rounds.qc | 23 +++++++++++------------ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/source/server/ai/ai_core.qc b/source/server/ai/ai_core.qc index 97fbc79..56c40f6 100644 --- a/source/server/ai/ai_core.qc +++ b/source/server/ai/ai_core.qc @@ -88,7 +88,7 @@ entity(entity blarg) find_new_enemy = while(targets != world) { // Don't target downed players. - if (targets.downed == true) { + if (targets.downed == true || targets.isspec == true) { targets = find(targets, classname, "player"); continue; } diff --git a/source/server/damage.qc b/source/server/damage.qc index 65a12b7..3fc49e0 100644 --- a/source/server/damage.qc +++ b/source/server/damage.qc @@ -176,7 +176,7 @@ void() EndGameSetup = void() rec_downed = { self.downedloop++; - if (self.downedloop == 300) { + if (self.downedloop >= 300) { startspectate(); return; } diff --git a/source/server/rounds.qc b/source/server/rounds.qc index 29871cc..669c6c0 100644 --- a/source/server/rounds.qc +++ b/source/server/rounds.qc @@ -121,6 +121,17 @@ void() updateDogRound = void() EndRound = { + entity who = find(world,classname,"spectator"); + while(who != world) + { + if(who.isspec) + { + self = who; + PlayerSpawn(); + } + who = find(who, classname, "spectator"); + } + rounds_change = 4; SetUpdate(self, UT_ROUNDS_CHANGE, rounds_change, 0, 0); if (gotdog && rounds == dogRound) { @@ -153,18 +164,6 @@ void() PlayerSpawn; void() NewRound = { - entity who = find(world,classname,"spectator"); - while(who != world) - { - if(who.isspec) - { - self = who; - PlayerSpawn(); - break; - } - - } - entity tempe; round_changetime = 0; spawn_time = time + 5;