From d7717a92abdd2e6d9d8c5db5ce1f0aeecf04937d Mon Sep 17 00:00:00 2001 From: Peridexis Errant Date: Sat, 9 May 2015 17:29:03 +1000 Subject: [PATCH] Add burial.lua by Putnam It's useful, and why not? --- NEWS | 1 + Readme.rst | 5 +++++ scripts/burial.lua | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 scripts/burial.lua diff --git a/NEWS b/NEWS index b552e67c6..e80cc238a 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ DFHack Future New scripts view-item-info: adds information and customisable descriptions to item viewscreens fix-ster: changes fertility/sterility of animals or dwarves + burial: sets all unowned coffins to allow burial ("-pets" to allow pets too) New tweaks New features dwarfmonitor date format can be modified (see Readme) diff --git a/Readme.rst b/Readme.rst index e24c0b1a1..d4d2c7eb8 100644 --- a/Readme.rst +++ b/Readme.rst @@ -2247,6 +2247,11 @@ If the name of the patch has no extension or directory separators, the script uses ``hack/patches//.dif``, thus auto-selecting the version appropriate for the currently loaded executable. +burial +====== +Sets all unowned coffins to allow burial. ``burial -pets`` also allows burial +of pets. + create-items ============ Spawn arbitrary items under the cursor. diff --git a/scripts/burial.lua b/scripts/burial.lua new file mode 100644 index 000000000..b73ac9327 --- /dev/null +++ b/scripts/burial.lua @@ -0,0 +1,19 @@ +-- allows burial in unowned coffins +-- by Putnam https://gist.github.com/Putnam3145/e7031588f4d9b24b9dda + +local utils=require('utils') + +validArgs = validArgs or utils.invert({ + 'pets' +}) + +local args = utils.processArgs({...}, validArgs) + +for k,v in ipairs(df.global.world.buildings.other.COFFIN) do + if v.owner_id==-1 then + v.burial_mode.allow_burial=true + if not args.pets then + v.burial_mode.no_pets=true + end + end +end \ No newline at end of file