Changeset - r8180:30eb63434e7e
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2008-01-01 22:39:11
rubidium@openttd.org
(svn r11743) -Fix [FS#1614]: group names got not deallocated in the command test run.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/group_cmd.cpp
Show inline comments
 
@@ -187,24 +187,26 @@ CommandCost CmdRenameGroup(TileIndex til
 

	
 
	/* Create the name */
 
	StringID str = AllocateName(_cmd_text, 0);
 
	if (str == STR_NULL) return CMD_ERROR;
 

	
 
	if (flags & DC_EXEC) {
 
		/* Delete the old name */
 
		DeleteName(g->string_id);
 
		/* Assign the new one */
 
		g->string_id = str;
 

	
 
		InvalidateWindowData(GetWCForVT(g->vehicle_type), (g->vehicle_type << 11) | VLW_GROUP_LIST | _current_player);
 
	} else {
 
		DeleteName(str);
 
	}
 

	
 
	return CommandCost();
 
}
 

	
 

	
 
/**
 
 * Add a vehicle to a group
 
 * @param tile unused
 
 * @param p1   index of array group
 
 *   - p1 bit 0-15 : GroupID
 
 * @param p2   vehicle to add to a group
0 comments (0 inline, 0 general)