diff --git a/plugins/rename.cpp b/plugins/rename.cpp index 8ffc3af05..9cd864042 100644 --- a/plugins/rename.cpp +++ b/plugins/rename.cpp @@ -40,7 +40,9 @@ DFhackCExport command_result plugin_init (Core *c, std::vector & "rename", "Rename various things.", rename, false, " rename squad \"name\"\n" " rename hotkey \"name\"\n" + " (identified by ordinal index)\n" " rename unit \"nickname\"\n" + " rename unit-profession \"custom profession\"\n" " (a unit must be highlighted in the ui)\n" )); } @@ -123,6 +125,17 @@ static command_result rename(Core * c, vector ¶meters) if (figure) set_nickname(&figure->name, parameters[1]); } + else if (cmd == "unit-profession") + { + if (parameters.size() != 2) + return CR_WRONG_USAGE; + + df::unit *unit = getSelectedUnit(c); + if (!unit) + return CR_WRONG_USAGE; + + unit->custom_profession = parameters[1]; + } else { if (!parameters.empty() && cmd != "?")