From 26c15a1d5177ddc3592a6625118104ea1fd8fd0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 28 Feb 2012 23:33:02 +0100 Subject: [PATCH] Nuke wagons, move regrass to devel, bump to a dev version. --- CMakeLists.txt | 2 +- plugins/CMakeLists.txt | 2 - plugins/devel/CMakeLists.txt | 2 + plugins/{ => devel}/regrass.cpp | 0 plugins/fixwagons.cpp | 103 -------------------------------- 5 files changed, 3 insertions(+), 106 deletions(-) rename plugins/{ => devel}/regrass.cpp (100%) delete mode 100644 plugins/fixwagons.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 31f257812..3ea4e0dc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ set(DF_VERSION_MINOR "34") set(DF_VERSION_PATCH "03") set(DF_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}") -set(DFHACK_RELEASE "1") +set(DFHACK_RELEASE "1-dev0") set(DFHACK_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}-r${DFHACK_RELEASE}") add_definitions(-DDFHACK_VERSION="${DFHACK_VERSION}") diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 8d3fa645a..f04726a44 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -71,9 +71,7 @@ if (BUILD_SUPPORTED) DFHACK_PLUGIN(initflags initflags.cpp) DFHACK_PLUGIN(stockpiles stockpiles.cpp) DFHACK_PLUGIN(rename rename.cpp) - DFHACK_PLUGIN(fixwagons fixwagons.cpp) DFHACK_PLUGIN(jobutils jobutils.cpp) - DFHACK_PLUGIN(regrass regrass.cpp) DFHACK_PLUGIN(workflow workflow.cpp) DFHACK_PLUGIN(showmood showmood.cpp) DFHACK_PLUGIN(fixveins fixveins.cpp) diff --git a/plugins/devel/CMakeLists.txt b/plugins/devel/CMakeLists.txt index 147a109b6..1d5b5a835 100644 --- a/plugins/devel/CMakeLists.txt +++ b/plugins/devel/CMakeLists.txt @@ -13,3 +13,5 @@ DFHACK_PLUGIN(tilesieve tilesieve.cpp) DFHACK_PLUGIN(frozen frozen.cpp) DFHACK_PLUGIN(dumpmats dumpmats.cpp) #DFHACK_PLUGIN(tiles tiles.cpp) +DFHACK_PLUGIN(regrass regrass.cpp) + diff --git a/plugins/regrass.cpp b/plugins/devel/regrass.cpp similarity index 100% rename from plugins/regrass.cpp rename to plugins/devel/regrass.cpp diff --git a/plugins/fixwagons.cpp b/plugins/fixwagons.cpp deleted file mode 100644 index 3f27dc6dc..000000000 --- a/plugins/fixwagons.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// I'll fix his little red wagon... - -#include "Core.h" -#include "Console.h" -#include "Export.h" -#include "PluginManager.h" - -#include "DataDefs.h" -#include "df/world.h" -#include "df/historical_entity.h" -#include "df/entity_raw.h" -#include "df/creature_raw.h" -#include "df/caste_raw.h" - -using std::string; -using std::vector; -using namespace DFHack; -using namespace df::enums; - -using df::global::world; - -command_result df_fixwagons (Core *c, vector ¶meters) -{ - if (!parameters.empty()) - return CR_WRONG_USAGE; - - CoreSuspender suspend(c); - int32_t wagon_creature = -1, wagon_puller_creature = -1; - df::creature_raw *wagon, *wagon_puller; - for (size_t i = 0; i < world->raws.creatures.all.size(); i++) - { - df::creature_raw *cr = world->raws.creatures.all[i]; - if (cr->flags.is_set(creature_raw_flags::EQUIPMENT_WAGON) && (wagon_creature == -1)) - { - wagon = cr; - wagon_creature = i; - } - if ((cr->creature_id == "HORSE") && (wagon_puller_creature == -1)) - { - wagon_puller = cr; - wagon_puller_creature = i; - } - } - if (wagon_creature == -1) - { - c->con.printerr("Couldn't find a valid wagon creature!\n"); - return CR_FAILURE; - } - if (wagon_puller_creature == -1) - { - c->con.printerr("Couldn't find 'HORSE' creature for default wagon puller!\n"); - return CR_FAILURE; - } - int count = 0; - for (size_t i = 0; i < world->entities.all.size(); i++) - { - bool updated = false; - df::historical_entity *ent = world->entities.all[i]; - if (!ent->entity_raw->flags.is_set(entity_raw_flags::COMMON_DOMESTIC_PULL)) - continue; - if (ent->resources.animals.wagon_races.size() == 0) - { - updated = true; - for (size_t j = 0; j < wagon->caste.size(); j++) - { - ent->resources.animals.wagon_races.push_back(wagon_creature); - ent->resources.animals.wagon_castes.push_back(j); - } - } - if (ent->resources.animals.wagon_puller_races.size() == 0) - { - updated = true; - for (size_t j = 0; j < wagon_puller->caste.size(); j++) - { - ent->resources.animals.wagon_puller_races.push_back(wagon_puller_creature); - ent->resources.animals.wagon_puller_castes.push_back(j); - } - } - if (updated) - count++; - } - if(count) - c->con.print("Fixed %d civilizations to bring wagons once again.\n", count); - return CR_OK; -} - -DFHACK_PLUGIN("fixwagons"); - -DFhackCExport command_result plugin_init ( Core * c, std::vector &commands) -{ - commands.push_back(PluginCommand( - "fixwagons", "Fix all civilizations to be able to bring wagons.", - df_fixwagons, false, - " Since DF v0.31.1 merchants no longer bring wagons due to a bug.\n" - " This command re-enables them for all appropriate civilizations.\n" - )); - return CR_OK; -} - -DFhackCExport command_result plugin_shutdown ( Core * c ) -{ - return CR_OK; -}