Fix treasure string conversion (#1016)
This commit is contained in:
parent
9aab93c4b3
commit
e95cdf59c2
@ -21,12 +21,12 @@ function ctf_map.treasure.treasure_from_string(str)
|
||||
|
||||
local out = {}
|
||||
|
||||
for name, min_count, max_count, max_stacks, rarity in str:gmatch("([^%;]+);(%d*);(%d*);(%d*);(%d*);%d;") do
|
||||
for name, min_count, max_count, max_stacks, rarity in str:gmatch("([^%;]+);(%d*);(%d*);(%d*);([%d.]*);%d;") do
|
||||
out[name] = {
|
||||
min_count = min_count or 1,
|
||||
max_count = max_count or 1,
|
||||
max_stacks = max_stacks or 1,
|
||||
rarity = rarity or 0.5,
|
||||
min_count = tonumber(min_count) or 1,
|
||||
max_count = tonumber(max_count) or 1,
|
||||
max_stacks = tonumber(max_stacks) or 1,
|
||||
rarity = tonumber(rarity) or 0.5,
|
||||
TREASURE_VERSION,
|
||||
}
|
||||
end
|
||||
@ -51,4 +51,4 @@ function ctf_map.treasure.treasure_to_string(treasures)
|
||||
end
|
||||
|
||||
return out
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user