diff options
author | Paul Gilbert | 2015-01-24 23:53:56 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-24 23:53:56 -0500 |
commit | 482c2b2ac8cff51d435d20b348e668dd77386af2 (patch) | |
tree | af8f051a2325f2ed5f36066b0ed68ca65d1e453a /engines/xeen | |
parent | 51dba2606e1cf202d73d7c77ba15939268bb6efd (diff) | |
download | scummvm-rg350-482c2b2ac8cff51d435d20b348e668dd77386af2.tar.gz scummvm-rg350-482c2b2ac8cff51d435d20b348e668dd77386af2.tar.bz2 scummvm-rg350-482c2b2ac8cff51d435d20b348e668dd77386af2.zip |
XEEN: Fix immediate crash in outdoors rendering
Diffstat (limited to 'engines/xeen')
-rw-r--r-- | engines/xeen/interface_map.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/engines/xeen/interface_map.cpp b/engines/xeen/interface_map.cpp index 43a467df9b..23b709d391 100644 --- a/engines/xeen/interface_map.cpp +++ b/engines/xeen/interface_map.cpp @@ -4423,25 +4423,30 @@ void InterfaceMap::drawOutdoors() { for (int idx = 0; idx < 9; ++idx) { map.getCell(TERRAIN_INDEXES1[idx]); - _outdoorList[36 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall]; + SpriteResource &spr = map._wallSprites._surfaces[map._currentWall]; + _outdoorList[36 + idx]._sprites = spr.size() == 0 ? (SpriteResource *)nullptr : &spr; } for (int idx = 0; idx < 5; ++idx) { map.getCell(TERRAIN_INDEXES2[idx]); - _outdoorList[61 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall]; + SpriteResource &spr = map._wallSprites._surfaces[map._currentWall]; + _outdoorList[61 + idx]._sprites = spr.size() == 0 ? (SpriteResource *)nullptr : &spr; } for (int idx = 0; idx < 3; ++idx) { map.getCell(TERRAIN_INDEXES3[idx]); - _outdoorList[84 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall]; + SpriteResource &spr = map._wallSprites._surfaces[map._currentWall]; + _outdoorList[84 + idx]._sprites = spr.size() == 0 ? (SpriteResource *)nullptr : &spr; } for (int idx = 0; idx < 5; ++idx) { map.getCell(TERRAIN_INDEXES4[idx]); - _outdoorList[103 + idx]._sprites = &map._wallSprites._surfaces[map._currentWall]; + SpriteResource &spr = map._wallSprites._surfaces[map._currentWall]; + _outdoorList[103 + idx]._sprites = spr.size() == 0 ? (SpriteResource *)nullptr : &spr; } map.getCell(1); - _outdoorList[108]._sprites = &map._wallSprites._surfaces[map._currentWall]; - _outdoorList[109]._sprites = &map._wallSprites._surfaces[map._currentWall]; - _outdoorList[110]._sprites = &map._wallSprites._surfaces[map._currentWall]; + SpriteResource &surface = map._wallSprites._surfaces[map._currentWall]; + _outdoorList[108]._sprites = surface.size() == 0 ? (SpriteResource *)nullptr : &surface; + _outdoorList[109]._sprites = _outdoorList[108]._sprites; + _outdoorList[110]._sprites = _outdoorList[108]._sprites; _outdoorList._sky1._flags = _outdoorList._sky2._flags = _flipSky ? SPRFLAG_HORIZ_FLIPPED : 0; _outdoorList._groundSprite._flags = _flipWater ? SPRFLAG_HORIZ_FLIPPED : 0; |