(svn r26450) -Feature: Hierarchical vehicle subgroups.

This commit is contained in:
peter1138
2014-04-08 21:09:06 +00:00
parent 1d8c673587
commit ed8f6f1a0f
11 changed files with 218 additions and 51 deletions

View File

@@ -21,6 +21,7 @@ static const SaveLoad _group_desc[] = {
SLE_VAR(Group, owner, SLE_UINT8),
SLE_VAR(Group, vehicle_type, SLE_UINT8),
SLE_VAR(Group, replace_protection, SLE_BOOL),
SLE_CONDVAR(Group, parent, SLE_UINT16, 189, SL_MAX_VERSION),
SLE_END()
};
@@ -42,6 +43,8 @@ static void Load_GRPS()
while ((index = SlIterateArray()) != -1) {
Group *g = new (index) Group();
SlObject(g, _group_desc);
if (IsSavegameVersionBefore(189)) g->parent = INVALID_GROUP;
}
}

View File

@@ -254,8 +254,9 @@
* 186 25833
* 187 25899
* 188 26169 1.4.x
* 189 26450
*/
extern const uint16 SAVEGAME_VERSION = 188; ///< Current savegame version of OpenTTD.
extern const uint16 SAVEGAME_VERSION = 189; ///< Current savegame version of OpenTTD.
SavegameType _savegame_type; ///< type of savegame we are loading