summaryrefslogtreecommitdiff
path: root/plugins/tweak.cpp
diff options
context:
space:
mode:
authorRobert Heinrich2012-04-14 13:36:22 +0200
committerRobert Heinrich2012-04-14 13:36:22 +0200
commit2100a95ad546ad0d4c85483e96357924c05c8b51 (patch)
treef584e6075dedb426913393c95cccd06a31febc4d /plugins/tweak.cpp
parentfba83bb5970e61e5c25158e10700cd8a529786cf (diff)
downloaddfhack-2100a95ad546ad0d4c85483e96357924c05c8b51.tar.gz
dfhack-2100a95ad546ad0d4c85483e96357924c05c8b51.tar.bz2
dfhack-2100a95ad546ad0d4c85483e96357924c05c8b51.tar.xz
zone: fixed major derp (assign commands would accidentally free caged creatures). tweak: added cheat to kidnap caravan escorts (works fine even for other races, does NOT work for traders because they can't be assigned any labors for whatever reason)
Diffstat (limited to 'plugins/tweak.cpp')
-rw-r--r--plugins/tweak.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/tweak.cpp b/plugins/tweak.cpp
index 3ac6bae8..4c100cc4 100644
--- a/plugins/tweak.cpp
+++ b/plugins/tweak.cpp
@@ -101,6 +101,8 @@ command_result fix_clothing_ownership(color_ostream &out, df::unit* unit)
{
df::unit_inventory_item* inv_item = unit->inventory[j];
df::item* item = inv_item->item;
+ // unforbid items (for the case of kidnapping caravan escorts who have their stuff forbidden by default)
+ inv_item->item->flags.bits.forbid = 0;
if(inv_item->mode == df::unit_inventory_item::T_mode::Worn)
{
// ignore armor?
@@ -207,6 +209,26 @@ static command_result tweak(color_ostream &out, vector <string> &parameters)
return fix_clothing_ownership(out, unit);
}
+ else if (cmd == "makeown")
+ {
+ // force a unit into your fort, regardless of civ or race
+ // allows to "steal" caravan guards etc
+ df::unit *unit = getSelectedUnit(out);
+ if (!unit)
+ {
+ out << "No unit selected!" << endl;
+ return CR_FAILURE;
+ }
+ if (unit->flags2.bits.resident)
+ unit->flags2.bits.resident = 0;
+ if(unit->flags1.bits.merchant)
+ unit->flags1.bits.merchant = 0;
+ if(unit->flags1.bits.forest)
+ unit->flags1.bits.forest = 0;
+ if(unit->civ_id != df::global::ui->civ_id)
+ unit->civ_id = df::global::ui->civ_id;
+ return fix_clothing_ownership(out, unit);
+ }
else
return CR_WRONG_USAGE;