Remove: whole keys only if empty

This commit is contained in:
Coder12a
2019-06-28 15:43:28 -05:00
parent db914eec5a
commit d00c120cd5
3 changed files with 32 additions and 5 deletions

View File

@ -52,7 +52,7 @@ end
--! @brief claim a parcel, update power and update global parcels table
function factions.unclaim_parcel(name, parcelpos)
factions.parcels.remove(parcelpos)
factions.remove_key(factions.parcels, parcelpos, nil, "faction", true)
local faction = factions.factions.get(name)