diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index a50d9722..5c5b6a0d 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -1286,13 +1286,19 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int //Rule 4 is a horizontal line, 5 is vertical //Rule 6 is a crew member + bool custom_gray; #if !defined(NO_CUSTOM_LEVELS) // Special case for gray Warp Zone tileset! - const RoomProperty* const room = cl.getroomprop(game.roomx - 100, game.roomy - 100); - bool custom_gray = room->tileset == 3 && room->tilecol == 6; -#else - bool custom_gray = false; + if (map.custommode) + { + const RoomProperty* const room = cl.getroomprop(game.roomx - 100, game.roomy - 100); + custom_gray = room->tileset == 3 && room->tilecol == 6; + } + else #endif + { + custom_gray = false; + } entclass& entity = *entptr; entity.xp = xp; diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index da68ba43..9e310795 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -1913,13 +1913,19 @@ void Graphics::drawentity(const int i, const int yoff) SDL_Rect drawRect; + bool custom_gray; #if !defined(NO_CUSTOM_LEVELS) // Special case for gray Warp Zone tileset! - const RoomProperty* const room = cl.getroomprop(game.roomx - 100, game.roomy - 100); - const bool custom_gray = room->tileset == 3 && room->tilecol == 6; -#else - const bool custom_gray = false; + if (map.custommode) + { + const RoomProperty* const room = cl.getroomprop(game.roomx - 100, game.roomy - 100); + custom_gray = room->tileset == 3 && room->tilecol == 6; + } + else #endif + { + custom_gray = false; + } SDL_Texture* sprites = flipmode ? grphx.im_flipsprites : grphx.im_sprites; SDL_Texture* tiles = (map.custommode && !map.finalmode) ? grphx.im_entcolours : grphx.im_tiles;