diff --git a/burial.lua b/burial.lua index 3bc7f1072c..d6ce884014 100644 --- a/burial.lua +++ b/burial.lua @@ -1,5 +1,6 @@ -- Allows burial in unowned coffins. -- Based on Putnam's work (https://gist.github.com/Putnam3145/e7031588f4d9b24b9dda) + local argparse = require('argparse') local quickfort = reqscript('quickfort') @@ -18,20 +19,12 @@ local tomb_blueprint = { local tomb_count = 0 for _, coffin in pairs(df.global.world.buildings.other.COFFIN) do - - if cur_zlevel and coffin.z ~= df.global.window_z then + if #coffin.relations > 0 or cur_zlevel and coffin.z ~= df.global.window_z then goto skip end - for _, zone in pairs(coffin.relations) do - if zone.type == df.civzone_type.Tomb then - goto skip - end - end - tomb_blueprint.pos = xyz2pos(coffin.x1, coffin.y1, coffin.z) quickfort.apply_blueprint(tomb_blueprint) tomb_count = tomb_count + 1 - ::skip:: end diff --git a/docs/burial.rst b/docs/burial.rst index 506d1a8715..1923384572 100644 --- a/docs/burial.rst +++ b/docs/burial.rst @@ -5,7 +5,8 @@ burial :summary: Create tomb zones for unzoned coffins. :tags: fort productivity buildings -Creates a 1x1 tomb zone for each built coffin that isn't already in a tomb. +Creates a 1x1 tomb zone for each built coffin that isn't already contained in a +zone. Usage ----- @@ -16,16 +17,16 @@ Examples -------- ``burial`` - Create a tomb for every coffin on the map with automatic burial enabled. + Create a general use tomb for every unzoned coffin on the map. ``burial -z`` Create tombs only on the current zlevel. ``burial -c`` - Create tombs designated for automatic burial of citizens only. + Create tombs designated for burial of citizens only. ``burial -p`` - Create tombs designated for automatic burial of pets only. + Create tombs designated for burial of pets only. ``burial -cp`` Create tombs with automatic burial disabled for both citizens and pets,