1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 17:39:09 +00:00

Codechange: [Script] Don't report multiple errors on valuator/filter failure (#14303)

This commit is contained in:
Loïc Guilloux
2025-05-30 14:38:41 +02:00
committed by GitHub
parent 10c159a79f
commit 2cd3c8db86
4 changed files with 10 additions and 15 deletions

View File

@@ -2112,6 +2112,11 @@ function Regression::Start()
local list = AIList();
list.AddItem(0, 0);
local Infinite = function(id) { while(true); }
try {
list = AIIndustryList(Infinite);
} catch (e) {
print("constructor failed with: " + e);
}
list.Valuate(Infinite);
}

View File

@@ -9792,20 +9792,10 @@ ERROR: IsEnd() is invalid as Begin() is never called
-2147483648 > 2147483647: false
13725 > -2147483648: true
--Valuate() with excessive CPU usage--
constructor failed with: excessive CPU usage in list filter function
Your script made an error: excessive CPU usage in valuator function
*FUNCTION [unknown()] regression/main.nut line [2114]
*FUNCTION [Valuate()] NATIVE line [-1]
*FUNCTION [Start()] regression/main.nut line [2115]
[id] 0
[this] TABLE
[Infinite] CLOSURE
[list] INSTANCE
[this] INSTANCE
Your script made an error: excessive CPU usage in valuator function
*FUNCTION [Start()] regression/main.nut line [2115]
*FUNCTION [Start()] regression/main.nut line [2120]
[Infinite] CLOSURE
[list] INSTANCE