Skip to content

Commit

Permalink
Merge pull request #895 from vallode/fix-forbid-vector
Browse files Browse the repository at this point in the history
Change items.all to items.other.IN_PLAY for forbid scripts
  • Loading branch information
myk002 authored Nov 17, 2023
2 parents 03c7186 + db1bb2c commit 020580f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions forbid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()]

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion unforbid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 020580f

Please sign in to comment.