Skip to content

Commit db1bb2c

Browse files
committed
Change items.all to items.other.IN_PLAY for forbid scripts
1 parent d55c3ba commit db1bb2c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

forbid.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local argparse = require('argparse')
55
local function getForbiddenItems()
66
local items = {}
77

8-
for _, item in pairs(df.global.world.items.all) do
8+
for _, item in pairs(df.global.world.items.other.IN_PLAY) do
99
if item.flags.forbid then
1010
local item_type = df.item_type[item:getType()]
1111

@@ -59,7 +59,7 @@ if positionals[1] == "all" then
5959
print("Forbidding all items on the map...")
6060

6161
local count = 0
62-
for _, item in pairs(df.global.world.items.all) do
62+
for _, item in pairs(df.global.world.items.other.IN_PLAY) do
6363
item.flags.forbid = true
6464
count = count + 1
6565
end
@@ -73,7 +73,7 @@ if positionals[1] == "unreachable" then
7373
local citizens = dfhack.units.getCitizens(true)
7474
local count = 0
7575

76-
for _, item in pairs(df.global.world.items.all) do
76+
for _, item in pairs(df.global.world.items.other.IN_PLAY) do
7777
if item.flags.construction or item.flags.in_building or item.flags.artifact then
7878
goto skipitem
7979
end

unforbid.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ local function unforbid_all(include_unreachable, quiet, include_worn)
99

1010
local citizens = dfhack.units.getCitizens(true)
1111
local count = 0
12-
for _, item in pairs(df.global.world.items.all) do
12+
for _, item in pairs(df.global.world.items.other.IN_PLAY) do
1313
if item.flags.forbid then
1414
if not include_unreachable then
1515
local reachable = false

0 commit comments

Comments
 (0)