E.g the scenario "chest_foodspoil" contains:
chestfunctions = require("scenarios/chestfunctions")
loot =
{
{
item = "spoiled_food",
count = 10
},
{
item = "blueprint",
count = 4,
},
}
and the scenario "chest_explosive" contains:
chestfunctions = require("scenarios/chestfunctions")
loot =
{
{
item = "firestaff",
--initfn = function(inst) inst.components.finiteuses:SetUses(TUNING.ICESTAFF_USES*math.random()) end,
count = 1
},
{
item = "ash",
count = 10
},
{
item = "gunpowder",
count = 4
},
{
item = "log",
count = 4
},
}
I'm quite sure that it has to be
local loot =
Because when spawning some chests with theses scenario, the chests will contain wrong items. See "Steps to reproduce"
Same of course for every other sceanrio or file that doesn't use local variables...
Steps to Reproduce
Spawn a chest with "chest_explosive" and a chest with "chest_foodspoil". Open both of them. They will contain the same items, although they should be different. This is because the same (global) loot variable is used, instead of an local one.
Spawn a chest with "chest_explosive" and a chest with "chest_foodspoil". Open both of them. They will contain the same items, although they should be different. This is because the same (global) loot variable is used, instead of an local one.
A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now