diff options
author | frosch <frosch@openttd.org> | 2013-12-23 18:09:29 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2013-12-23 18:09:29 +0000 |
commit | 49852e3dac0e59377b440a23c514608e714846f2 (patch) | |
tree | ba094a330655085516bd75bd560973ae29cd64b3 /src/newgrf_storage.h | |
parent | eca86d1baf5f374d25dcc9bf0ff2bad328bdffab (diff) | |
download | openttd-49852e3dac0e59377b440a23c514608e714846f2.tar.xz |
(svn r26175) -Add: Log in desync output when persistent storage is discarded.
Diffstat (limited to 'src/newgrf_storage.h')
-rw-r--r-- | src/newgrf_storage.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/newgrf_storage.h b/src/newgrf_storage.h index c4c4addbf..7dccb053c 100644 --- a/src/newgrf_storage.h +++ b/src/newgrf_storage.h @@ -13,12 +13,17 @@ #define NEWGRF_STORAGE_H #include "core/pool_type.hpp" +#include "tile_type.h" /** * Base class for all persistent NewGRF storage arrays. Nothing fancy, only here * so we have a generalised access to the virtual methods. */ struct BasePersistentStorageArray { + uint32 grfid; ///< GRFID associated to this persistent storage. A value of zero means "default". + byte feature; ///< NOSAVE: Used to identify in the owner of the array in debug output. + TileIndex tile; ///< NOSAVE: Used to identify in the owner of the array in debug output. + virtual ~BasePersistentStorageArray(); /** @@ -198,14 +203,14 @@ extern PersistentStoragePool _persistent_storage_pool; /** * Class for pooled persistent storage of data. - * On #ClearChanges that data is always zero-ed. */ struct PersistentStorage : PersistentStorageArray<int32, 16>, PersistentStoragePool::PoolItem<&_persistent_storage_pool> { - uint32 grfid; ///< GRFID associated to this persistent storage. A value of zero means "default". - /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ - PersistentStorage(const uint32 new_grfid) : grfid(new_grfid) + PersistentStorage(const uint32 new_grfid, byte feature, TileIndex tile) { + this->grfid = new_grfid; + this->feature = feature; + this->tile = tile; } }; |