# HG changeset patch # User nemo # Date 1542832903 18000 # Node ID 9b5a8147386ff022adbfcb39959da15e1acc7cd3 # Parent 2b54c956813e889235677a3bded7592fcbc862bb I think this is correct way to use iterate over it as a hashmap. don't have much lua practice diff -r 2b54c956813e -r 9b5a8147386f share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua Wed Nov 21 15:28:52 2018 -0500 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua Wed Nov 21 15:41:43 2018 -0500 @@ -535,11 +535,11 @@ SetGearAIHints(hhs[i], aihDoesntMatter) end end - for i = 0, #crates do - if CurrentHedgehog == mutant and crate[i] ~= nil then - SetGearAIHints(crates[i], aihDoesntMatter) + for k,v in pairs(crates) do + if CurrentHedgehog == mutant and v ~= nil then + SetGearAIHints(v, aihDoesntMatter) else - SetGearAIHints(crates[i], aihUsualProcessing) + SetGearAIHints(v, aihUsualProcessing) end end end @@ -729,7 +729,7 @@ numhhs = numhhs + 1 SetEffect(gear, heResurrectable, 1) elseif GetGearType(gear) == gtCase then - crates[#crates] = gear + crates[gear] = gear elseif GetGearType(gear) == gtATFinishGame then if not gameOver then local winner = createEndGameStats()