Changeset - r1774:8a98bfdc381f
[Not reviewed]
master
0 1 0
tron - 19 years ago 2005-05-07 08:14:06
tron@openttd.org
(svn r2278) When renaming a station, check if the station exists and belongs to the correct player
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
station_cmd.c
Show inline comments
 
@@ -2650,12 +2650,16 @@ int32 CmdRenameStation(int x, int y, uin
 
	StringID str,old_str;
 
	Station *st;
 

	
 
	if (!IsStationIndex(p1)) return CMD_ERROR;
 
	st = GetStation(p1);
 

	
 
	if (!IsValidStation(st) || !CheckOwnership(st->owner)) return CMD_ERROR;
 

	
 
	str = AllocateNameUnique((const char*)_decode_parameters, 6);
 
	if (str == 0)
 
		return CMD_ERROR;
 

	
 
	if (flags & DC_EXEC) {
 
		st = GetStation(p1);
 
		old_str = st->string_id;
 
		st->string_id = str;
 
		UpdateStationVirtCoord(st);
0 comments (0 inline, 0 general)