From 49852e3dac0e59377b440a23c514608e714846f2 Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 23 Dec 2013 18:09:29 +0000 Subject: (svn r26175) -Add: Log in desync output when persistent storage is discarded. --- src/newgrf_storage.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/newgrf_storage.h') 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, 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; } }; -- cgit v1.2.3-54-g00ecf