ll.ListReplaceList has an off-by-one error in slua
planned
Tapple Gao
in slua:
local t = {"a", "b", "c", "d"}
local u = ll.ListReplaceList(t, {"x"}, 2, 2)
print("t", lljson.encode(t)) -- t ["a","b","c","d"]
print("u", lljson.encode(u)) -- u ["a","x","b","d"] -- expected ["a","x","c","d"]
lsl is fine:
default { state_entry() {
list t = ["a", "b", "c", "d"];
list u = llListReplaceList(t, ["x"], 1, 1);
llOwnerSay("t: " + llList2Json(JSON_ARRAY, t)); // t: ["a","b","c", "d"]
llOwnerSay("u: " + llList2Json(JSON_ARRAY, u)); // u: ["a","x","c", "d"] // correct
}}
llcompat is fine:
local t = {"a", "b", "c", "d"}
local u = llcompat.ListReplaceList(t, {"x"}, 1, 1)
print("t", lljson.encode(t)) -- t ["a","b","c", "d"]
print("u", lljson.encode(u)) -- u ["a","x","c", "d"]
Log In
H
Harold Linden
marked this post as
planned
thanks for the report! I'll get this sorted
Tapple Gao
I can't find any similar bug in
ll.ListInsertList
, ll.DeleteSubList
, or ll.List2List