forked from mirror/OpenTTD
Codechange: [Script] Don't report multiple errors on valuator/filter failure (#14303)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -932,7 +932,7 @@ SQInteger ScriptList::Valuate(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
/* Call the function. Squirrel pops all parameters and pushes the return value. */
|
||||
if (SQ_FAILED(sq_call(vm, nparam + 1, SQTrue, SQTrue))) {
|
||||
if (SQ_FAILED(sq_call(vm, nparam + 1, SQTrue, SQFalse))) {
|
||||
ScriptObject::SetAllowDoCommand(backup_allow);
|
||||
return SQ_ERROR;
|
||||
}
|
||||
|
@@ -111,9 +111,9 @@ protected:
|
||||
}
|
||||
|
||||
/* Call the function. Squirrel pops all parameters and pushes the return value. */
|
||||
if (SQ_FAILED(sq_call(vm, nparam + 1, SQTrue, SQTrue))) {
|
||||
if (SQ_FAILED(sq_call(vm, nparam + 1, SQTrue, SQFalse))) {
|
||||
ScriptObject::SetAllowDoCommand(backup_allow);
|
||||
throw sq_throwerror(vm, "failed to run filter");
|
||||
throw static_cast<SQInteger>(SQ_ERROR);
|
||||
}
|
||||
|
||||
SQBool add = SQFalse;
|
||||
|
Reference in New Issue
Block a user