Changeset - r20910:0cfca604a1aa
[Not reviewed]
master
0 1 0
rubidium - 11 years ago 2013-11-08 22:28:57
rubidium@openttd.org
(svn r25956) -Fix [FS#5772]: temporary persistent storage modifications, e.g. command tests or those from GUI, were not properly reset, creating the possibility of desyncs
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/newgrf_storage.h
Show inline comments
 
@@ -84,7 +84,7 @@ struct PersistentStorageArray : BaseStor
 
		if (this->storage[pos] == value) return;
 

	
 
		/* We do not have made a backup; lets do so */
 
		if (this->prev_storage != NULL) {
 
		if (this->prev_storage == NULL) {
 
			this->prev_storage = MallocT<TYPE>(SIZE);
 
			memcpy(this->prev_storage, this->storage, sizeof(this->storage));
 

	
 
@@ -121,6 +121,7 @@ struct PersistentStorageArray : BaseStor
 
			memcpy(this->storage, this->prev_storage, sizeof(this->storage));
 
		}
 
		free(this->prev_storage);
 
		this->prev_storage = NULL;
 
	}
 
};
 

	
0 comments (0 inline, 0 general)