aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2023-05-11 18:09:47 +0100
committerGitHub <noreply@github.com>2023-05-11 19:09:47 +0200
commitd205d4440ffbf0947ca5cf4a2705157ba2d873e2 (patch)
treeb302ef5a156b88228b09b45bbd9de0cad12e7500 /Northstar.CustomServers/mod/scripts
parent9181e52e0af606986af3c733ad78360f16a40be8 (diff)
downloadNorthstarMods-d205d4440ffbf0947ca5cf4a2705157ba2d873e2.tar.gz
NorthstarMods-d205d4440ffbf0947ca5cf4a2705157ba2d873e2.zip
Fix attrition freezing and killing servers sometimes (#642)v1.14.2-rc1v1.14.2
Would occur when NPCs would try to find somewhere to attack after all enemy NPCs nearby were dead
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut11
1 files changed, 11 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut
index 702e4500..f47ee90f 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<entity> 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()