summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-03-19 21:00:15 +0000
committerterkhen <terkhen@openttd.org>2010-03-19 21:00:15 +0000
commit81ca76a65588ae4cfc516fb26ddc1c878c84d09b (patch)
treee96c3888bc18e960494c94c7356a5cdc61711737
parentea58a697c1ba032292e3d15f559fc567cc459434 (diff)
downloadopenttd-81ca76a65588ae4cfc516fb26ddc1c878c84d09b.tar.xz
(svn r19475) -Cleanup: Remove an unneeded for when drawing detail panels.
-rw-r--r--src/build_vehicle_gui.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index 0f34ad575..4a0636788 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -1154,13 +1154,11 @@ struct BuildVehicleWindow : Window {
if (!this->IsShaded()) {
int needed_height = this->details_height;
/* Draw details panels. */
- for (int side = 0; side < 2; side++) {
- if (this->sel_engine != INVALID_ENGINE) {
- NWidgetBase *nwi = this->GetWidget<NWidgetBase>(BUILD_VEHICLE_WIDGET_PANEL);
- int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT,
- nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine);
- needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM);
- }
+ if (this->sel_engine != INVALID_ENGINE) {
+ NWidgetBase *nwi = this->GetWidget<NWidgetBase>(BUILD_VEHICLE_WIDGET_PANEL);
+ int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT,
+ nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine);
+ needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM);
}
if (needed_height != this->details_height) { // Details window are not high enough, enlarge them.
this->details_height = needed_height;