summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-09-20 11:11:59 +0400
committerAlexander Gavrilov2012-09-20 11:11:59 +0400
commit462bedb75708043f3ef9520e8fb84640ebaec945 (patch)
treefeebdbfbb25e0a4611dd8c54b69c15d8aac3f57f /plugins
parentc39a33722316ee91f7a42abcd76149788dd19196 (diff)
downloaddfhack-462bedb75708043f3ef9520e8fb84640ebaec945.tar.gz
dfhack-462bedb75708043f3ef9520e8fb84640ebaec945.tar.bz2
dfhack-462bedb75708043f3ef9520e8fb84640ebaec945.tar.xz
Fix the rename plugin and script to use the new getSelectedBuilding API.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/rename.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/rename.cpp b/plugins/rename.cpp
index 99dc6848..f9de83bd 100644
--- a/plugins/rename.cpp
+++ b/plugins/rename.cpp
@@ -357,10 +357,11 @@ static command_result rename(color_ostream &out, vector <string> &parameters)
if (parameters.size() != 2)
return CR_WRONG_USAGE;
- if (ui->main.mode != ui_sidebar_mode::QueryBuilding)
+ df::building *bld = Gui::getSelectedBuilding(out, true);
+ if (!bld)
return CR_WRONG_USAGE;
- if (!renameBuilding(world->selected_building, parameters[1]))
+ if (!renameBuilding(bld, parameters[1]))
{
out.printerr("This type of building is not supported.\n");
return CR_FAILURE;