From b504eb67946b00cc850e52b2de9113e43353bb78 Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Mon, 20 May 2019 21:33:59 -0500 Subject: [PATCH] Fix: use iterate function --- chatcommands.lua | 4 ++-- diplomacy_events.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chatcommands.lua b/chatcommands.lua index df56a21..35315ac 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -330,7 +330,7 @@ factions.register_command("list", { infaction = false, global_privileges = def_global_privileges, on_success = function(player, faction, pos, parcelpos, args) - local list = factions.get_faction_list() + local list = factions.factions.iterate() local tosend = "Existing factions:" for i,v in ipairs(list) do @@ -1525,7 +1525,7 @@ factions.register_command("obliterate", { infaction = false, global_privileges = {"faction_admin"}, on_success = function(player, faction, pos, parcelpos, args) - for i, facname in pairs(factions.get_faction_list()) do + for i, facname in factions.factions.iterate() do factions.disband(facname, "obliterated") end return true diff --git a/diplomacy_events.lua b/diplomacy_events.lua index 54b510d..715981e 100644 --- a/diplomacy_events.lua +++ b/diplomacy_events.lua @@ -1,5 +1,5 @@ function factions.start_diplomacy(name, faction) - for l, i in pairs(factions.get_faction_list()) do + for l, i in factions.factions.iterate() do local fac = factions.factions.get(i) if i ~= name and not (faction.neutral[i] or faction.allies[i] or faction.enemies[i]) then if factions_config.faction_diplomacy == true then