don't crash for invalid coordinates

develop
myk002 2021-04-25 10:17:51 -07:00
parent e516cf1a80
commit e28bbd3a20
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 2 additions and 1 deletions

@ -81,7 +81,8 @@ pair<uint32_t, uint32_t> get_building_size(df::building* b)
char get_tile_dig(int32_t x, int32_t y, int32_t z) char get_tile_dig(int32_t x, int32_t y, int32_t z)
{ {
df::tiletype_shape ts = tileShape(*Maps::getTileType(x, y , z)); df::tiletype *tt = Maps::getTileType(x, y , z);
df::tiletype_shape ts = tileShape(tt ? *tt : tiletype::Void);
switch (ts) switch (ts)
{ {
case tiletype_shape::EMPTY: case tiletype_shape::EMPTY: