summaryrefslogtreecommitdiff
path: root/vehicle_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-28 06:21:03 +0000
committertron <tron@openttd.org>2006-06-28 06:21:03 +0000
commit6e67dc5d47f1b47eaa0eac2532a1c61b062b2c09 (patch)
tree329449f48fb360f15a378040554e69505236de71 /vehicle_gui.c
parent842b5180549fb0794341dbc9f1a468a68a7132ec (diff)
downloadopenttd-6e67dc5d47f1b47eaa0eac2532a1c61b062b2c09.tar.xz
(svn r5399) Simplify a conditional expression: (a && b) || (!a && !b) -> a == b
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r--vehicle_gui.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c
index 2d3edfd34..967b6ae60 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -538,9 +538,8 @@ static void SetupScrollStuffForReplaceWindow(Window *w)
const EngineInfo* info = EngInfo(eid);
// left window contains compatible engines while right window only contains engines of the selected type
- if (ENGINE_AVAILABLE && (
- (RailVehInfo(eid)->power != 0 && WP(w, replaceveh_d).wagon_btnstate) ||
- (RailVehInfo(eid)->power == 0 && !WP(w, replaceveh_d).wagon_btnstate))) {
+ if (ENGINE_AVAILABLE &&
+ (RailVehInfo(eid)->power != 0) == (WP(w, replaceveh_d).wagon_btnstate != 0)) {
if (IsCompatibleRail(e->railtype, railtype) && (_player_num_engines[eid] > 0 || EngineHasReplacementForPlayer(p, eid))) {
if (sel[0] == count) selected_id[0] = eid;
count++;