fixed timing issue for AirGroup health check task removal (#58)

Co-authored-by: ex61wi <tim.rorije@ing.com>
This commit is contained in:
2025-07-07 14:45:11 +02:00
committed by GitHub
co-authored by ex61wi
parent f558426dc8
commit 3d19137970
+4 -1
View File
@@ -163,7 +163,10 @@ function AirGroup:SpawnInternal(force, withoutLoadout)
end
if self._checkLivenessNumber then
timer.removeFunction(self._checkLivenessNumber)
--try remove. Throws Error when number does not exist anymore, hence the pcall
pcall(function()
timer.removeFunction(self._checkLivenessNumber)
end)
end
self._checkLivenessNumber = timer.scheduleFunction(CheckLivenessTask, self, timer.getTime() + 5)