From db1bb2cc1e9200c972cb16b5e59a86c0d44837e1 Mon Sep 17 00:00:00 2001 From: vallode <18506096+vallode@users.noreply.github.com> Date: Thu, 16 Nov 2023 10:28:32 +0100 Subject: [PATCH] Change items.all to items.other.IN_PLAY for forbid scripts --- forbid.lua | 6 +++--- unforbid.lua | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/forbid.lua b/forbid.lua index b0be9536f9..4a09732703 100644 --- a/forbid.lua +++ b/forbid.lua @@ -5,7 +5,7 @@ local argparse = require('argparse') local function getForbiddenItems() local items = {} - for _, item in pairs(df.global.world.items.all) do + for _, item in pairs(df.global.world.items.other.IN_PLAY) do if item.flags.forbid then local item_type = df.item_type[item:getType()] @@ -59,7 +59,7 @@ if positionals[1] == "all" then print("Forbidding all items on the map...") local count = 0 - for _, item in pairs(df.global.world.items.all) do + for _, item in pairs(df.global.world.items.other.IN_PLAY) do item.flags.forbid = true count = count + 1 end @@ -73,7 +73,7 @@ if positionals[1] == "unreachable" then local citizens = dfhack.units.getCitizens(true) local count = 0 - for _, item in pairs(df.global.world.items.all) do + for _, item in pairs(df.global.world.items.other.IN_PLAY) do if item.flags.construction or item.flags.in_building or item.flags.artifact then goto skipitem end diff --git a/unforbid.lua b/unforbid.lua index 12b7430c36..286218a211 100644 --- a/unforbid.lua +++ b/unforbid.lua @@ -9,7 +9,7 @@ local function unforbid_all(include_unreachable, quiet, include_worn) local citizens = dfhack.units.getCitizens(true) local count = 0 - for _, item in pairs(df.global.world.items.all) do + for _, item in pairs(df.global.world.items.other.IN_PLAY) do if item.flags.forbid then if not include_unreachable then local reachable = false