forked from mirror/OpenTTD
(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
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "economy.h"
|
||||
#include "network.h"
|
||||
#include "variables.h"
|
||||
#include "train.h"
|
||||
|
||||
#ifdef ENABLE_NETWORK
|
||||
#include "network_data.h"
|
||||
@@ -432,7 +433,7 @@ static void DrawPlayerVehiclesAmount(PlayerID player)
|
||||
FOR_ALL_VEHICLES(v) {
|
||||
if (v->owner == player) {
|
||||
switch (v->type) {
|
||||
case VEH_Train: if (v->subtype == TS_Front_Engine) train++; break;
|
||||
case VEH_Train: if (IsFrontEngine(v)) train++; break;
|
||||
case VEH_Road: road++; break;
|
||||
case VEH_Aircraft: if (v->subtype <= 2) air++; break;
|
||||
case VEH_Ship: ship++; break;
|
||||
|
Reference in New Issue
Block a user