diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/scenes/sceneDbg.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/engines/fullpipe/scenes/sceneDbg.cpp b/engines/fullpipe/scenes/sceneDbg.cpp index 9df8c2766b..2ba59778ba 100644 --- a/engines/fullpipe/scenes/sceneDbg.cpp +++ b/engines/fullpipe/scenes/sceneDbg.cpp @@ -41,19 +41,21 @@ void sceneDbgMenu_initScene(Scene *sc) { } GameObject *sceneHandlerDbgMenu_getObjectAtXY(int x, int y) { - if (g_fp->_currentScene) - for (uint i = 1; i < g_fp->_currentScene->_picObjList.size(); i++) { - PictureObject *pic = (PictureObject *)g_fp->_currentScene->_picObjList[i]; + if (!g_fp->_currentScene) + return 0; + + for (uint i = 1; i < g_fp->_currentScene->_picObjList.size(); i++) { + PictureObject *pic = (PictureObject *)g_fp->_currentScene->_picObjList[i]; - if (x >= pic->_ox && y >= pic->_oy) { - Common::Point point; + if (x >= pic->_ox && y >= pic->_oy) { + Common::Point point; - pic->getDimensions(&point); + pic->getDimensions(&point); - if (x <= pic->_ox + point.x && y <= pic->_oy + point.y && pic != g_vars->selector) - return pic; - } + if (x <= pic->_ox + point.x && y <= pic->_oy + point.y && pic != g_vars->selector) + return pic; } + } return 0; } |