Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
STARK: Fix crash when interacting with the game window when no level …
Browse files Browse the repository at this point in the history
…is loaded
  • Loading branch information
bgK authored and Dougaak committed May 21, 2018
1 parent 09d775e commit acc9cd4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion engines/stark/ui/world/gamewindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ void GameWindow::onMouseMove(const Common::Point &pos) {
}

void GameWindow::onClick(const Common::Point &pos) {
if (!StarkGlobal->getCurrent()) {
return; // No level is loaded yet, interaction is impossible
}

if (!StarkUserInterface->isInteractive()) {
StarkUserInterface->markInteractionDenied();
return;
Expand All @@ -148,7 +152,7 @@ void GameWindow::onClick(const Common::Point &pos) {

if (_objectUnderCursor) {
if (singlePossibleAction != -1) {
StarkGameInterface->itemDoActionAt(_objectUnderCursor, singlePossibleAction, _objectRelativePosition);
StarkGameInterface->itemDoActionAt(_objectUnderCursor, singlePossibleAction, _objectRelativePosition);
} else if (selectedInventoryItem == -1) {
_actionMenu->open(_objectUnderCursor, _objectRelativePosition);
}
Expand Down

0 comments on commit acc9cd4

Please sign in to comment.