File diff r10570:e200b86ce378 → r10571:99cb9a95b4cf
src/group_cmd.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file group_cmd.cpp Handling of the engine groups */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "variables.h"
 
#include "command_func.h"
 
#include "saveload.h"
 
#include "debug.h"
 
#include "group.h"
 
#include "train.h"
 
#include "aircraft.h"
 
#include "vehicle_gui.h"
 
#include "strings_func.h"
 
@@ -418,43 +417,6 @@ void RemoveAllGroupsForCompany(const Com
 
	Group *g;
 

	
 
	FOR_ALL_GROUPS(g) {
 
		if (company == g->owner) delete g;
 
	}
 
}
 

	
 

	
 
static const SaveLoad _group_desc[] = {
 
  SLE_CONDVAR(Group, name,           SLE_NAME,    0, 83),
 
  SLE_CONDSTR(Group, name,           SLE_STR, 0, 84, SL_MAX_VERSION),
 
  SLE_VAR(Group, num_vehicle,        SLE_UINT16),
 
  SLE_VAR(Group, owner,              SLE_UINT8),
 
  SLE_VAR(Group, vehicle_type,       SLE_UINT8),
 
  SLE_VAR(Group, replace_protection, SLE_BOOL),
 
  SLE_END()
 
};
 

	
 

	
 
static void Save_GROUP(void)
 
{
 
	Group *g;
 

	
 
	FOR_ALL_GROUPS(g) {
 
		SlSetArrayIndex(g->index);
 
		SlObject(g, _group_desc);
 
	}
 
}
 

	
 

	
 
static void Load_GROUP(void)
 
{
 
	int index;
 

	
 
	while ((index = SlIterateArray()) != -1) {
 
		Group *g = new (index) Group();
 
		SlObject(g, _group_desc);
 
	}
 
}
 

	
 
extern const ChunkHandler _group_chunk_handlers[] = {
 
	{ 'GRPS', Save_GROUP, Load_GROUP, CH_ARRAY | CH_LAST},
 
};