(svn r4706) - NewGRF: add the correct default error message for the wagon attach callback.
authorpeter1138
Wed, 03 May 2006 06:24:14 +0000
changeset 3729 c4ef8b67998f
parent 3728 1ebf0a7a2492
child 3730 1aca9dabaeea
(svn r4706) - NewGRF: add the correct default error message for the wagon attach callback.
lang/english.txt
train_cmd.c
--- a/lang/english.txt	Tue May 02 21:58:02 2006 +0000
+++ b/lang/english.txt	Wed May 03 06:24:14 2006 +0000
@@ -2514,6 +2514,7 @@
 
 STR_TRAIN_STOPPING                                              :{RED}Stopping
 STR_TRAIN_STOPPING_VEL                                          :{RED}Stopping, {VELOCITY}
+STR_INCOMPATIBLE_RAIL_TYPES                                     :Incompatible rail types
 
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Road vehicle in the way
--- a/train_cmd.c	Tue May 02 21:58:02 2006 +0000
+++ b/train_cmd.c	Wed May 03 06:24:14 2006 +0000
@@ -1081,7 +1081,7 @@
 		/* Check NewGRF Callback 0x1D */
 		uint16 callback = GetVehicleCallbackParent(CBID_TRAIN_ALLOW_WAGON_ATTACH, 0, 0, dst_head->engine_type, src, dst_head);
 		if (callback != CALLBACK_FAILED) {
-			if (callback == 0xFD) return CMD_ERROR;
+			if (callback == 0xFD) return_cmd_error(STR_INCOMPATIBLE_RAIL_TYPES);
 			if (callback < 0xFD) {
 				StringID error = GetGRFStringID(GetEngineGRFID(dst_head->engine_type), 0xD000 + callback);
 				return_cmd_error(error);