GOB: fix a crash in Adibou2 when changing hotspot

The leave function should not be called for hotspot "0"
This commit is contained in:
Simon Delamarre 2022-10-29 00:43:38 +02:00 committed by Eugene Sandulenko
parent 95ddb1ca87
commit b2c3510758
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -811,12 +811,13 @@ uint16 Hotspots::check(uint8 handleMouse, int16 delay, uint16 &id, uint16 &index
((delay <= 0) || (_vm->_game->_mouseButtons == kMouseButtonsNone)))
_vm->_draw->blitCursor();
if ((key != _currentKey) && (_vm->getGameType() != kGameTypeFascination) &&
(_vm->getGameType() != kGameTypeGeisha))
// If the hotspot changed, leave the old one
// Code not present in Fascination executables
leave(_currentIndex);
if ((_currentKey != 0) &&
(key != _currentKey) &&
(_vm->getGameType() != kGameTypeFascination) &&
(_vm->getGameType() != kGameTypeGeisha))
// If the hotspot changed, leave the old one
// Code not present in Fascination executables
leave(_currentIndex);
_currentKey = 0;
break;