From 4e5326e25d33b6a8ca5d67b2a7c477baed4e9684 Mon Sep 17 00:00:00 2001 From: lethosor Date: Wed, 6 May 2015 18:47:40 -0400 Subject: [PATCH] Only allow quicksave to be used in fortress mode --- NEWS | 1 + scripts/quicksave.lua | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/NEWS b/NEWS index 793abd4e1..fda78b704 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,7 @@ DFHack Future Misc Improvements "keybinding list" accepts a context nyan: Can now be stopped with dfhack-run + quicksave: Restricted to fortress mode Removed DFHack 0.40.24-r3 diff --git a/scripts/quicksave.lua b/scripts/quicksave.lua index f4886b35b..8617c6f4d 100644 --- a/scripts/quicksave.lua +++ b/scripts/quicksave.lua @@ -4,6 +4,10 @@ if not dfhack.isMapLoaded() then qerror("World and map aren't loaded.") end +if not dfhack.world.isFortressMode() then + qerror('This script can only be used in fortress mode') +end + local ui_main = df.global.ui.main local flags4 = df.global.d_init.flags4