1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-26 07:59:09 +00:00

(svn r17650) -Codechange: Checking a condition once is enough.

This commit is contained in:
alberth
2009-09-26 19:26:08 +00:00
parent f7120de1f7
commit dd108f2399

View File

@@ -870,10 +870,7 @@ struct DepotWindow : Window {
} }
} break; } break;
case DEPOT_WIDGET_SELL: case DEPOT_WIDGET_SELL_CHAIN: case DEPOT_WIDGET_SELL: case DEPOT_WIDGET_SELL_CHAIN: {
if (!this->IsWidgetDisabled(DEPOT_WIDGET_SELL) &&
this->sel != INVALID_VEHICLE) {
if (this->IsWidgetDisabled(widget)) return; if (this->IsWidgetDisabled(widget)) return;
if (this->sel == INVALID_VEHICLE) return; if (this->sel == INVALID_VEHICLE) return;
@@ -893,8 +890,8 @@ struct DepotWindow : Window {
} }
if (!DoCommandP(v->tile, v->index, sell_cmd, GetCmdSellVeh(v->type)) && is_engine) _backup_orders_tile = 0; if (!DoCommandP(v->tile, v->index, sell_cmd, GetCmdSellVeh(v->type)) && is_engine) _backup_orders_tile = 0;
} } break;
break;
default: default:
this->sel = INVALID_VEHICLE; this->sel = INVALID_VEHICLE;
this->SetDirty(); this->SetDirty();