diff options
| author | Alexander Gavrilov | 2012-09-20 11:11:59 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-09-20 11:11:59 +0400 |
| commit | 462bedb75708043f3ef9520e8fb84640ebaec945 (patch) | |
| tree | feebdbfbb25e0a4611dd8c54b69c15d8aac3f57f /plugins | |
| parent | c39a33722316ee91f7a42abcd76149788dd19196 (diff) | |
| download | dfhack-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.cpp | 5 |
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> ¶meters) 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; |
