From 3802412d688262bcdeb4dd7239c45667e5730b00 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Sat, 18 Aug 2018 14:57:26 -0500 Subject: [PATCH] autofarm: suspend while processing --- plugins/devel/autofarm.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plugins/devel/autofarm.cpp b/plugins/devel/autofarm.cpp index 8a79d3f61..aaee2764e 100644 --- a/plugins/devel/autofarm.cpp +++ b/plugins/devel/autofarm.cpp @@ -39,12 +39,6 @@ DFHACK_PLUGIN("autofarm"); DFHACK_PLUGIN_IS_ENABLED(enabled); -static void process(color_ostream &out) -{ - CoreSuspender suspend; - -} - const char *tagline = "Automatically handle crop selection in farm plots based on current plant stocks."; const char *usage = ( "autofarm enable\n" @@ -350,7 +344,10 @@ DFhackCExport command_result plugin_onupdate(color_ostream &out) if (world->frame_counter % 50 != 0) // Check every hour return CR_OK; - autofarmInstance->process(out); + { + CoreSuspender suspend; + autofarmInstance->process(out); + } return CR_OK; }