From 39a7a0eeced2ecdb7c38cee6b469e5857ae86084 Mon Sep 17 00:00:00 2001 From: SMUnlimited Date: Sat, 21 Dec 2024 16:53:35 +0000 Subject: [PATCH] Help prevent lag #472 --- Jobs/ARMY_TRACK.eai | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jobs/ARMY_TRACK.eai b/Jobs/ARMY_TRACK.eai index 2c2ff6746..b8c9d9f43 100644 --- a/Jobs/ARMY_TRACK.eai +++ b/Jobs/ARMY_TRACK.eai @@ -265,7 +265,9 @@ function UpdateTownThreat takes nothing returns nothing endif loop exitwhen i >= town_num - //exitwhen i != lastFreeNum and ModuloInteger(i, 10) == 0 this would cause most threatened town to be negative during this calculation which would break other processes + if i > 0 and ModuloInteger(i, 10) == 0 then + call Sleep(0.01) // This can take along time, but this could cause most threatened town to be wrong in other processes, so sleep so at least no other jobs can use this yet + endif call UpdateSpecificTownThreat(i) set i = i + 1 endloop