diff options
author | rubidium <rubidium@openttd.org> | 2010-08-28 18:23:14 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-08-28 18:23:14 +0000 |
commit | bd488934787b3587ec5048db59a7dd14c164ca70 (patch) | |
tree | 548528641f87567720c66c780dddbd5a4ec7cfc0 /src/saveload | |
parent | c481e3b110da20085a77f55625e564a7baa772a8 (diff) | |
download | openttd-bd488934787b3587ec5048db59a7dd14c164ca70.tar.xz |
(svn r20656) -Codechange: implement counting of objects
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/afterload.cpp | 1 | ||||
-rw-r--r-- | src/saveload/object_sl.cpp | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 388faceee..95a379c9d 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -1875,6 +1875,7 @@ bool AfterLoadGame() o->build_date = _date; o->town = type == OBJECT_STATUE ? Town::Get(_m[t].m2) : CalcClosestTownFromTile(t, UINT_MAX); _m[t].m2 = o->index; + Object::IncTypeCount(type); } else { /* We're at an offset, so get the ID from our "root". */ TileIndex northern_tile = t - TileXY(GB(offset, 0, 4), GB(offset, 4, 4)); diff --git a/src/saveload/object_sl.cpp b/src/saveload/object_sl.cpp index 0e36100c3..6218eea1e 100644 --- a/src/saveload/object_sl.cpp +++ b/src/saveload/object_sl.cpp @@ -11,6 +11,7 @@ #include "../stdafx.h" #include "../object_base.h" +#include "../object_map.h" #include "saveload.h" #include "newgrf_sl.h" @@ -50,6 +51,7 @@ static void Ptrs_OBJS() Object *o; FOR_ALL_OBJECTS(o) { SlObject(o, _object_desc); + Object::IncTypeCount(GetObjectType(o->location.tile)); } } |