From d182b6c1c3b21e38091a1dc2a62f9da414168acf Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Tue, 24 Mar 2015 17:46:49 -0500 Subject: [PATCH] only create the stocksettings directory when it is requested --- plugins/lua/stockpiles.lua | 3 +++ plugins/stockpiles/stockpiles.cpp | 17 +---------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/plugins/lua/stockpiles.lua b/plugins/lua/stockpiles.lua index 8b318eb0f..815a551b7 100644 --- a/plugins/lua/stockpiles.lua +++ b/plugins/lua/stockpiles.lua @@ -138,6 +138,9 @@ function save_settings(stockpile) if filename == nil or filename == '' then script.showMessage('Stockpile Settings', 'Invalid File Name', COLOR_RED) else + if not dfhack.filesystem.exists(path) then + dfhack.filesystem.mkdir(path) + end print("saving...", path..'/'..filename) stockpiles_save(path..'/'..filename) end diff --git a/plugins/stockpiles/stockpiles.cpp b/plugins/stockpiles/stockpiles.cpp index 572612980..936052a15 100644 --- a/plugins/stockpiles/stockpiles.cpp +++ b/plugins/stockpiles/stockpiles.cpp @@ -95,14 +95,6 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector params; params.push_back ( filename );