Changeset - r18366:929c29262060
[Not reviewed]
master
0 1 0
frosch - 13 years ago 2011-11-14 16:09:58
frosch@openttd.org
(svn r23212) -Fix [FS#4834] (r22980): Deleting groups did not update statistics of DEFAULT group.
1 file changed with 3 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/group_cmd.cpp
Show inline comments
 
@@ -313,14 +313,10 @@ CommandCost CmdDeleteGroup(TileIndex til
 
	Group *g = Group::GetIfValid(p1);
 
	if (g == NULL || g->owner != _current_company) return CMD_ERROR;
 

	
 
	if (flags & DC_EXEC) {
 
		Vehicle *v;
 
	/* Remove all vehicles from the group */
 
	DoCommand(0, p1, 0, flags, CMD_REMOVE_ALL_VEHICLES_GROUP);
 

	
 
		/* Add all vehicles belong to the group to the default group */
 
		FOR_ALL_VEHICLES(v) {
 
			if (v->group_id == g->index && v->type == g->vehicle_type) v->group_id = DEFAULT_GROUP;
 
		}
 

	
 
	if (flags & DC_EXEC) {
 
		/* Update backupped orders if needed */
 
		OrderBackup::ClearGroup(g->index);
 

	
0 comments (0 inline, 0 general)