Changeset - r15457:4874828c361b
[Not reviewed]
master
0 2 0
terkhen - 14 years ago 2010-07-10 20:18:59
terkhen@openttd.org
(svn r20116) -Add: Show an specific error message when trying to convert/remove nonexistant signals.
2 files changed with 8 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -3551,6 +3551,7 @@ STR_ERROR_CAN_T_REMOVE_RAILROAD_TRACK   
 
STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM                             :{WHITE}Can't remove signals from here...
 
STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE                     :{WHITE}Can't convert signals here...
 
STR_ERROR_THERE_IS_NO_RAILROAD_TRACK                            :{WHITE}...there is no railway track
 
STR_ERROR_THERE_ARE_NO_SIGNALS                                  :{WHITE}...there are no signals
 

	
 
STR_ERROR_CAN_T_CONVERT_RAIL                                    :{WHITE}Can't convert railtype here...
 

	
src/rail_cmd.cpp
Show inline comments
 
@@ -948,7 +948,7 @@ CommandCost CmdBuildSingleSignal(TileInd
 
	if (HasBit(p1, 17) && HasSignalOnTrack(tile, track)) return CommandCost();
 

	
 
	/* you can not convert a signal if no signal is on track */
 
	if (convert_signal && !HasSignalOnTrack(tile, track)) return CMD_ERROR;
 
	if (convert_signal && !HasSignalOnTrack(tile, track)) return_cmd_error(STR_ERROR_THERE_ARE_NO_SIGNALS);
 

	
 
	CommandCost cost;
 
	if (!HasSignalOnTrack(tile, track)) {
 
@@ -1220,7 +1220,11 @@ static CommandCost CmdSignalTrackHelper(
 
				had_success = true;
 
				total_cost.AddCost(ret);
 
			} else {
 
				last_error = ret;
 
				/* The "No railway" error is the least important one. */
 
				if (ret.GetErrorMessage() != STR_ERROR_THERE_IS_NO_RAILROAD_TRACK ||
 
						last_error.GetErrorMessage() == INVALID_STRING_ID) {
 
					last_error = ret;
 
				}
 
			}
 
		}
 

	
 
@@ -1288,7 +1292,7 @@ CommandCost CmdRemoveSingleSignal(TileIn
 
		return_cmd_error(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK);
 
	}
 
	if (!HasSignalOnTrack(tile, track)) {
 
		return CMD_ERROR;
 
		return_cmd_error(STR_ERROR_THERE_ARE_NO_SIGNALS);
 
	}
 
	CommandCost ret = EnsureNoTrainOnTrack(tile, track);
 
	if (ret.Failed()) return ret;
0 comments (0 inline, 0 general)