summaryrefslogtreecommitdiff
path: root/src/newgrf_storage.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-06-11 20:47:31 +0000
committerfrosch <frosch@openttd.org>2011-06-11 20:47:31 +0000
commitd5e7537e14521481539a9da1745ce6a2790fcefa (patch)
treeffbd425373d61cde3601a99a0331445924dc3ec7 /src/newgrf_storage.h
parentb2275b40935603d15030a8f79fff1f56bdb5ab0e (diff)
downloadopenttd-d5e7537e14521481539a9da1745ce6a2790fcefa.tar.xz
(svn r22552) -Fix: Clear airport persistent storage on construction/removal of airports.
Diffstat (limited to 'src/newgrf_storage.h')
-rw-r--r--src/newgrf_storage.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/newgrf_storage.h b/src/newgrf_storage.h
index f03308509..a7f5788c4 100644
--- a/src/newgrf_storage.h
+++ b/src/newgrf_storage.h
@@ -62,6 +62,12 @@ struct PersistentStorageArray : BaseStorageArray {
free(this->prev_storage);
}
+ /** Resets all values to zero. */
+ void ResetToZero()
+ {
+ memset(this->storage, 0, sizeof(this->storage));
+ }
+
/**
* Stores some value at a given position.
* If there is no backup of the data that backup is made and then