mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-28 17:09:10 +00:00
Add: [Script] Cloning ScriptList
This commit is contained in:
@@ -828,6 +828,13 @@ function Regression::List()
|
||||
print(" []:");
|
||||
print(" 4000 => " + list[4000]);
|
||||
|
||||
print(" clone:");
|
||||
local list3 = clone list;
|
||||
print(" Clone ListDump:");
|
||||
foreach (idx, val in list3) {
|
||||
print(" " + idx + " => " + val);
|
||||
}
|
||||
|
||||
list.Clear();
|
||||
print(" IsEmpty(): " + list.IsEmpty());
|
||||
|
||||
@@ -860,6 +867,12 @@ function Regression::List()
|
||||
it = list.Next();
|
||||
print(" " + it + " => " + list.GetValue(it));
|
||||
}
|
||||
|
||||
print(" Clone ListDump:");
|
||||
foreach (idx, val in list3) {
|
||||
print(" " + idx + " => " + val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Regression::Map()
|
||||
|
@@ -575,6 +575,13 @@
|
||||
4006 => 12
|
||||
[]:
|
||||
4000 => 50
|
||||
clone:
|
||||
Clone ListDump:
|
||||
1005 => 1005
|
||||
4000 => 50
|
||||
4001 => 8002
|
||||
4002 => 8004
|
||||
4006 => 12
|
||||
IsEmpty(): true
|
||||
0 => 5 (true)
|
||||
ERROR: Next() is invalid as Begin() is never called
|
||||
@@ -584,6 +591,12 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
2 => 6 (true)
|
||||
3 => 6 (true)
|
||||
9 => 0 (false)
|
||||
Clone ListDump:
|
||||
1005 => 1005
|
||||
4000 => 50
|
||||
4001 => 8002
|
||||
4002 => 8004
|
||||
4006 => 12
|
||||
|
||||
--Company--
|
||||
SetName(): true
|
||||
@@ -9795,7 +9808,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
constructor failed with: excessive CPU usage in list filter function
|
||||
Your script made an error: excessive CPU usage in valuator function
|
||||
|
||||
*FUNCTION [Start()] regression/main.nut line [2120]
|
||||
*FUNCTION [Start()] regression/main.nut line [2133]
|
||||
|
||||
[Infinite] CLOSURE
|
||||
[list] INSTANCE
|
||||
|
Reference in New Issue
Block a user