diff --git a/plugins/tweak.cpp b/plugins/tweak.cpp index 3ac6bae85..4c100cc48 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 ¶meters) 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; diff --git a/plugins/zone.cpp b/plugins/zone.cpp index c668abe99..1e90aa1cf 100644 --- a/plugins/zone.cpp +++ b/plugins/zone.cpp @@ -963,7 +963,6 @@ bool isInBuiltCage(df::unit* unit) { if(oldcage->assigned_creature[oc] == unit->id) { - oldcage->assigned_creature.erase(oldcage->assigned_creature.begin() + oc); caged = true; break; }