Fix treasure string conversion (#1016)

This commit is contained in:
Zardshard 2022-08-09 10:32:21 -04:00 committed by GitHub
parent 9aab93c4b3
commit e95cdf59c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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