src/player_gui.cpp
branchgamebalance
changeset 9912 1ac8aac92385
parent 9910 0b2aebc8283e
child 9913 e79cd19772dd
--- a/src/player_gui.cpp	Wed Jun 13 11:45:14 2007 +0000
+++ b/src/player_gui.cpp	Wed Jun 13 12:05:56 2007 +0000
@@ -17,6 +17,7 @@
 #include "economy.h"
 #include "network/network.h"
 #include "variables.h"
+#include "roadveh.h"
 #include "train.h"
 #include "aircraft.h"
 #include "date.h"
@@ -277,13 +278,14 @@
 	LC_ROAD, LC_ROAD,
 	LC_SHIP, LC_SHIP,
 	LC_AIRCRAFT, LC_AIRCRAFT, LC_AIRCRAFT,
+	LC_ROAD, LC_ROAD,
 };
 
 /* Number of liveries in each class, used to determine the height of the livery window */
 static const byte livery_height[] = {
 	1,
 	11,
-	2,
+	4,
 	2,
 	3,
 };
@@ -323,7 +325,7 @@
 	switch (e->event) {
 		case WE_CREATE:
 			LowerWindowWidget(w, WP(w, livery_d).livery_class + 2);
-			if (!_have_2cc) {
+			if (!HASBIT(_loaded_newgrf_features, GRFLOADED_2CC)) {
 				HideWindowWidget(w, 11);
 				HideWindowWidget(w, 12);
 			}
@@ -365,7 +367,7 @@
 					DrawSprite(SPR_SQUARE, GENERAL_SPRITE_COLOR(p->livery[scheme].colour1), 152, y);
 					DrawString(165, y, STR_00D1_DARK_BLUE + p->livery[scheme].colour1, sel ? 0xC : 2);
 
-					if (_have_2cc) {
+					if (HASBIT(_loaded_newgrf_features, GRFLOADED_2CC)) {
 						DrawSprite(SPR_SQUARE, GENERAL_SPRITE_COLOR(p->livery[scheme].colour2), 277, y);
 						DrawString(290, y, STR_00D1_DARK_BLUE + p->livery[scheme].colour2, sel ? 0xC : 2);
 					}
@@ -648,7 +650,7 @@
 		if (v->owner == player) {
 			switch (v->type) {
 				case VEH_TRAIN:    if (IsFrontEngine(v)) train++; break;
-				case VEH_ROAD:     road++; break;
+				case VEH_ROAD:     if (IsRoadVehFront(v)) road++; break;
 				case VEH_AIRCRAFT: if (IsNormalAircraft(v)) air++; break;
 				case VEH_SHIP:     ship++; break;
 				default: break;
@@ -793,7 +795,7 @@
 				}
 
 				case PCW_WIDGET_COLOR_SCHEME: {
-					Window *wf = AllocateWindowDescFront(_have_2cc ? &_select_player_livery_2cc_desc : &_select_player_livery_desc, w->window_number);
+					Window *wf = AllocateWindowDescFront(HASBIT(_loaded_newgrf_features, GRFLOADED_2CC) ? &_select_player_livery_2cc_desc : &_select_player_livery_desc, w->window_number);
 					if (wf != NULL) {
 						wf->caption_color = wf->window_number;
 						WP(wf, livery_d).livery_class = LC_OTHER;