summaryrefslogtreecommitdiff
path: root/main_gui.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2005-11-18 23:41:03 +0000
committerbjarni <bjarni@openttd.org>2005-11-18 23:41:03 +0000
commit22a46798378768271af6b90cd41327155a909dd2 (patch)
tree3dd0d12983f0eaa08af460475f1f8b0a2c961d75 /main_gui.c
parent40ec9bb1235a2231f0c883baaae73e106c67f1cf (diff)
downloadopenttd-22a46798378768271af6b90cd41327155a909dd2.tar.xz
(svn r3218) -Feature: Multiheaded train engines will now stay in the same train
This means that any user attempt to remove a rear engine will tell the user to move the front engine instead This fixes the assert when moving multiheaded engines (introduced in r3144) Note: to make old savegames use this feature, some engines might be turned around in order to link engines in pairs -Codechange: train subtype is now a bitmask This allows fast access to info like if it is a wagon or engine and if it is in front and so on Note: savegame version bump
Diffstat (limited to 'main_gui.c')
-rw-r--r--main_gui.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main_gui.c b/main_gui.c
index c3c8277ad..6272db3c8 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -26,6 +26,7 @@
#include "signs.h"
#include "waypoint.h"
#include "variables.h"
+#include "train.h"
#include "network_data.h"
#include "network_client.h"
@@ -799,7 +800,7 @@ static void ToolbarTrainClick(Window *w)
int dis = -1;
FOR_ALL_VEHICLES(v) {
- if (v->type == VEH_Train && v->subtype == TS_Front_Engine) CLRBIT(dis, v->owner);
+ if (v->type == VEH_Train && IsFrontEngine(v)) CLRBIT(dis, v->owner);
}
PopupMainPlayerToolbMenu(w, 310, 13, dis);
}