From d205d4440ffbf0947ca5cf4a2705157ba2d873e2 Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Thu, 11 May 2023 18:09:47 +0100 Subject: Fix attrition freezing and killing servers sometimes (#642) Would occur when NPCs would try to find somewhere to attack after all enemy NPCs nearby were dead --- .../mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut index 702e45002..f47ee90f9 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut @@ -460,7 +460,18 @@ void function SquadHandler( array guys ) // Get point and send our whole squad to it points = GetNPCArrayOfEnemies( team ) if ( points.len() == 0 ) // can't find any points here + { + // Have to wait some amount of time before continuing + // because if we don't the server will continue checking this + // forever, aren't loops fun? + // This definitely didn't waste ~8 hours of my time reverting various + // launcher PRs before finding this mods PR that caused servers to + // freeze forever before having their process killed by the dedi watchdog + // without any logging. If anyone reads this, PLEASE add logging to your scripts + // for when weird edge cases happen, it can literally only help debugging. -Spoon + WaitFrame() continue + } point = points[ RandomInt( points.len() ) ].GetOrigin() -- cgit v1.2.3