changeset 18167:9c82695de33e draft

(svn r22996) -Fix: make sure temporary storage is cleared before test and exec runs for DoCommands so NewGRF callbacks can't change the result between the runs
author yexo <yexo@openttd.org>
date Tue, 04 Oct 2011 20:36:40 +0000
parents f2edd8725120
children ac1c1cc6e8a4
files src/command.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -633,6 +633,7 @@
 		/* Test the command. */
 		_cleared_object_areas.Clear();
 		SetTownRatingTestMode(true);
+		ClearStorageChanges(false);
 		res = proc(tile, flags, p1, p2, text);
 		SetTownRatingTestMode(false);
 
@@ -672,6 +673,7 @@
 	/* Actually try and execute the command. If no cost-type is given
 	 * use the construction one */
 	_cleared_object_areas.Clear();
+	ClearStorageChanges(false);
 	CommandCost res2 = proc(tile, flags | DC_EXEC, p1, p2, text);
 
 	if (cmd_id == CMD_COMPANY_CTRL) {