diff options
author | Paul Gilbert | 2011-10-05 20:30:29 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-10-05 21:28:30 +1100 |
commit | fcf9dab0da8d5dcb852ca47dad44a8a984603035 (patch) | |
tree | c9f3f5f3b2db3e49976e47220939fb07c95291fe | |
parent | 2a2e0377f365cc417a61a5f031e38a0b09114616 (diff) | |
download | scummvm-rg350-fcf9dab0da8d5dcb852ca47dad44a8a984603035.tar.gz scummvm-rg350-fcf9dab0da8d5dcb852ca47dad44a8a984603035.tar.bz2 scummvm-rg350-fcf9dab0da8d5dcb852ca47dad44a8a984603035.zip |
TSAGE: Fix debugger hotspots command not to crash for objects with no defined area
-rw-r--r-- | engines/tsage/debugger.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index 7d4a42ea25..a0e8b9edba 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -457,8 +457,9 @@ bool Debugger::Cmd_Hotspots(int argc, const char **argv) { // Draw the contents of the hotspot area if (o->_sceneRegionId == 0) { // Scene item doesn't use a region, so fill in the entire area - destSurface.fillRect(Rect(o->_bounds.left - sceneBounds.left, o->_bounds.top - sceneBounds.top, - o->_bounds.right - sceneBounds.left - 1, o->_bounds.bottom - sceneBounds.top - 1), colIndex); + if ((o->_bounds.right > o->_bounds.left) && (o->_bounds.bottom > o->_bounds.top)) + destSurface.fillRect(Rect(o->_bounds.left - sceneBounds.left, o->_bounds.top - sceneBounds.top, + o->_bounds.right - sceneBounds.left - 1, o->_bounds.bottom - sceneBounds.top - 1), colIndex); } else { // Scene uses a region, so get it and use it to fill out only the correct parts SceneRegions::iterator ri = g_globals->_sceneRegions.begin(); |