diff --git a/maps/mountain_fortress_v3/functions.lua b/maps/mountain_fortress_v3/functions.lua index 06164d4d..9c670e05 100644 --- a/maps/mountain_fortress_v3/functions.lua +++ b/maps/mountain_fortress_v3/functions.lua @@ -1973,8 +1973,24 @@ function Public.equip_players(starting_items, recreate) Modifiers.update_player_modifiers(player) if not recreate then starting_items = starting_items or this.starting_items + if this.starting_items['modular-armor'] then + player.insert({ name = 'modular-armor', count = 1 }) + end + for item, item_data in pairs(this.starting_items) do - player.insert({ name = item, count = item_data.count }) + if item ~= 'modular-armor' then + local equip = prototypes.equipment[item] + if equip then + local p_armor = player.get_inventory(defines.inventory.character_armor) + if p_armor and p_armor.valid and p_armor[1] and p_armor[1].grid then + for _ = 1, item_data.count do + p_armor[1].grid.put({ name = item }) + end + end + else + player.insert({ name = item, count = item_data.count }) + end + end end end Public.show_all_gui(player) diff --git a/utils/commands/misc.lua b/utils/commands/misc.lua index af15ac3a..44ffab87 100644 --- a/utils/commands/misc.lua +++ b/utils/commands/misc.lua @@ -367,7 +367,7 @@ function Public.insert_all_items(player) this.players[player.index] = true - local p_armor = player.get_inventory(5)[1].grid + local p_armor = player.get_inventory(defines.inventory.character_armor)[1].grid if p_armor and p_armor.valid then p_armor.put({ name = 'fission-reactor-equipment', quality = quality }) p_armor.put({ name = 'fission-reactor-equipment', quality = quality })