diff options
author | orwell <orwell@bleipb.de> | 2025-01-29 22:17:31 +0100 |
---|---|---|
committer | orwell <orwell@bleipb.de> | 2025-01-29 22:17:31 +0100 |
commit | 5ba1c48589e855ab3143242de0eafe2890589969 (patch) | |
tree | 2315fb619f02549a450098e375eea0fd1ef11e0a /advtrains/occupation.lua | |
parent | 3d3871f8ea5173042238150b86ae5525a4761ad2 (diff) | |
download | advtrains-5ba1c48589e855ab3143242de0eafe2890589969.tar.gz advtrains-5ba1c48589e855ab3143242de0eafe2890589969.tar.bz2 advtrains-5ba1c48589e855ab3143242de0eafe2890589969.zip |
Try to narrow down heisenbug with endless loop
Diffstat (limited to 'advtrains/occupation.lua')
-rw-r--r-- | advtrains/occupation.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/advtrains/occupation.lua b/advtrains/occupation.lua index 20a986e..66ad36c 100644 --- a/advtrains/occupation.lua +++ b/advtrains/occupation.lua @@ -103,7 +103,9 @@ function o.clear_all_items(train_id, pos) local t = occget(pos) if not t then return end local i = 1 + local _cnt = 0 while t[i] do + _cnt = _cnt + 1; if _cnt > 10000 then error("Loop trap in advtrains.occ,clear_all_items was triggered!") end if t[i]==train_id then table.remove(t, i) table.remove(t, i) |