summaryrefslogtreecommitdiff
path: root/src/object_cmd.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-09-03 22:28:11 +0000
committeryexo <yexo@openttd.org>2010-09-03 22:28:11 +0000
commit9a0033cbf6ac68d002b561dc04c097126b5ef729 (patch)
tree665ce224d0a299464e2a6568ee53da746a91ede9 /src/object_cmd.cpp
parenta45b598bfcbbe46acbf9ea95d280fbf8d60a7b47 (diff)
downloadopenttd-9a0033cbf6ac68d002b561dc04c097126b5ef729.tar.xz
(svn r20730) -Fix: crash when removing an object while the newgrf debug window was open for that object
Diffstat (limited to 'src/object_cmd.cpp')
-rw-r--r--src/object_cmd.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index 2a5c229f6..1fb55f619 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -34,6 +34,7 @@
#include "newgrf_config.h"
#include "newgrf_object.h"
#include "date_func.h"
+#include "newgrf_debug.h"
#include "table/strings.h"
#include "table/object_land.h"
@@ -338,7 +339,11 @@ static Foundation GetFoundation_Object(TileIndex tile, Slope tileh)
static void ReallyClearObjectTile(Object *o)
{
Object::DecTypeCount(GetObjectType(o->location.tile));
- TILE_AREA_LOOP(tile_cur, o->location) MakeWaterKeepingClass(tile_cur, GetTileOwner(tile_cur));
+ TILE_AREA_LOOP(tile_cur, o->location) {
+ DeleteNewGRFInspectWindow(GSF_OBJECTS, tile_cur);
+
+ MakeWaterKeepingClass(tile_cur, GetTileOwner(tile_cur));
+ }
delete o;
}