Merge pull request #3373 from myk002/myk_gamey

[autolabor] adjust usage to game structure reunification
develop
Myk 2023-05-17 11:38:29 -07:00 committed by GitHub
commit 7c2216e196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

@ -1 +1 @@
Subproject commit 22d9bc0bc1847def8a6c62893104f36262e63e98
Subproject commit 9891be32663435f2fe875e27c70010d5618de735

@ -34,8 +34,8 @@
#include <df/items_other_id.h>
#include <df/plotinfost.h>
#include <df/activity_info.h>
#include <df/gamest.h>
#include <df/global_objects.h>
#include <df/gamest_extra.h>
#include <MiscUtils.h>
@ -51,7 +51,7 @@ using namespace df::enums;
DFHACK_PLUGIN("autolabor");
REQUIRE_GLOBAL(plotinfo);
REQUIRE_GLOBAL(world);
REQUIRE_GLOBAL(game_extra);
REQUIRE_GLOBAL(game);
#define ARRAY_COUNT(array) (sizeof(array)/sizeof((array)[0]))
@ -414,7 +414,7 @@ static void enable_plugin(color_ostream &out)
cleanup_state();
init_state();
df::global::game_extra->external_flag |= 1; // shut down DF's work detail system
game->external_flag |= 1; // shut down DF's work detail system
}
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
@ -1084,7 +1084,7 @@ DFhackCExport command_result plugin_enable ( color_ostream &out, bool enable )
enable_autolabor = false;
setOptionEnabled(CF_ENABLED, false);
df::global::game_extra->external_flag &= ~1; // reenable DF's work detail system
game->external_flag &= ~1; // reenable DF's work detail system
out << "Autolabor is disabled." << std::endl;
}