Skip to content

Commit 7f2c3e5

Browse files
committed
only create tombs for coffins not in a zone
that is, don't create tomb zones for coffins that are already in other types of zones
1 parent 9c77c52 commit 7f2c3e5

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

burial.lua

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
-- Allows burial in unowned coffins.
22
-- Based on Putnam's work (https://gist.github.com/Putnam3145/e7031588f4d9b24b9dda)
3+
34
local argparse = require('argparse')
45
local quickfort = reqscript('quickfort')
56

@@ -18,20 +19,12 @@ local tomb_blueprint = {
1819

1920
local tomb_count = 0
2021
for _, coffin in pairs(df.global.world.buildings.other.COFFIN) do
21-
22-
if cur_zlevel and coffin.z ~= df.global.window_z then
22+
if #coffin.relations > 0 or cur_zlevel and coffin.z ~= df.global.window_z then
2323
goto skip
2424
end
25-
for _, zone in pairs(coffin.relations) do
26-
if zone.type == df.civzone_type.Tomb then
27-
goto skip
28-
end
29-
end
30-
3125
tomb_blueprint.pos = xyz2pos(coffin.x1, coffin.y1, coffin.z)
3226
quickfort.apply_blueprint(tomb_blueprint)
3327
tomb_count = tomb_count + 1
34-
3528
::skip::
3629
end
3730

docs/burial.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ burial
55
:summary: Create tomb zones for unzoned coffins.
66
:tags: fort productivity buildings
77

8-
Creates a 1x1 tomb zone for each built coffin that isn't already in a tomb.
8+
Creates a 1x1 tomb zone for each built coffin that isn't already contained in a
9+
zone.
910

1011
Usage
1112
-----
@@ -16,16 +17,16 @@ Examples
1617
--------
1718

1819
``burial``
19-
Create a tomb for every coffin on the map with automatic burial enabled.
20+
Create a general use tomb for every unzoned coffin on the map.
2021

2122
``burial -z``
2223
Create tombs only on the current zlevel.
2324

2425
``burial -c``
25-
Create tombs designated for automatic burial of citizens only.
26+
Create tombs designated for burial of citizens only.
2627

2728
``burial -p``
28-
Create tombs designated for automatic burial of pets only.
29+
Create tombs designated for burial of pets only.
2930

3031
``burial -cp``
3132
Create tombs with automatic burial disabled for both citizens and pets,

0 commit comments

Comments
 (0)