summaryrefslogtreecommitdiff
path: root/plugins/tiletypes.cpp
diff options
context:
space:
mode:
authorPetr Mrázek2011-08-15 01:30:15 +0200
committerPetr Mrázek2011-08-15 01:30:15 +0200
commit292074116eb949a8902b5d295a58e49c04291c9c (patch)
tree8be95fd7fc292d4ce9a7e25c6768106e5a25896b /plugins/tiletypes.cpp
parenta0f99ef7079bb741dcfa44b7365e3b13f3ec9016 (diff)
downloaddfhack-292074116eb949a8902b5d295a58e49c04291c9c.tar.gz
dfhack-292074116eb949a8902b5d295a58e49c04291c9c.tar.bz2
dfhack-292074116eb949a8902b5d295a58e49c04291c9c.tar.xz
Fix crash bugs in liquids and tiletypes.
Diffstat (limited to 'plugins/tiletypes.cpp')
-rw-r--r--plugins/tiletypes.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/tiletypes.cpp b/plugins/tiletypes.cpp
index 16094e0f..4f07736a 100644
--- a/plugins/tiletypes.cpp
+++ b/plugins/tiletypes.cpp
@@ -605,7 +605,9 @@ DFhackCExport command_result df_tiletypes (Core * c, vector <string> & parameter
}
int32_t type = DFHack::findTileType(shape, material, source->variant, special, source->direction);
- map.setTiletypeAt(*iter, type);
+ // make sure it's not invalid
+ if(type != -1)
+ map.setTiletypeAt(*iter, type);
// Remove liquid from walls, etc
if (!DFHack::FlowPassable(shape))