mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-26 22:38:17 +00:00
KYRA/LOL: fixed hand item cursor bug
This fixes a bug when loading savegames with different active hand items via GMM. The mouse cursor was not set to the active hand item in these cases.
This commit is contained in:
parent
68e468ee01
commit
d7e700f370
@ -504,6 +504,11 @@ void KyraEngine_HoF::runLoop() {
|
||||
int inputFlag = checkInput(_buttonList, true);
|
||||
removeInputTop();
|
||||
|
||||
if (_updateHandItemCursor) {
|
||||
_updateHandItemCursor = false;
|
||||
setHandItem(_itemInHand);
|
||||
}
|
||||
|
||||
update();
|
||||
|
||||
if (inputFlag == 198 || inputFlag == 199) {
|
||||
|
@ -819,6 +819,11 @@ void KyraEngine_LoK::updateMousePointer(bool forceUpdate) {
|
||||
newY = 4;
|
||||
}
|
||||
|
||||
if (_updateHandItemCursor) {
|
||||
_updateHandItemCursor = false;
|
||||
setHandItem(_itemInHand);
|
||||
}
|
||||
|
||||
if ((newMouseState && _mouseState != newMouseState) || (newMouseState && forceUpdate)) {
|
||||
_mouseState = newMouseState;
|
||||
_screen->hideMouse();
|
||||
|
@ -966,6 +966,11 @@ void KyraEngine_MR::runLoop() {
|
||||
int inputFlag = checkInput(_mainButtonList, true);
|
||||
removeInputTop();
|
||||
|
||||
if (_updateHandItemCursor) {
|
||||
_updateHandItemCursor = false;
|
||||
setHandItem(_itemInHand);
|
||||
}
|
||||
|
||||
update();
|
||||
_timer->update();
|
||||
|
||||
|
@ -65,6 +65,7 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
|
||||
_gameToLoad = -1;
|
||||
|
||||
_mouseState = -1;
|
||||
_updateHandItemCursor = false;
|
||||
_deathHandler = -1;
|
||||
|
||||
memset(_flagsTable, 0, sizeof(_flagsTable));
|
||||
|
@ -343,6 +343,9 @@ protected:
|
||||
virtual void setHandItem(Item item) = 0;
|
||||
virtual void removeHandItem() = 0;
|
||||
|
||||
void setDelayedCursorUpdate() { _updateHandItemCursor = true; }
|
||||
bool _updateHandItemCursor;
|
||||
|
||||
// game flags
|
||||
uint8 _flagsTable[100]; // TODO: check this value
|
||||
|
||||
|
@ -931,6 +931,11 @@ void LoLEngine::runLoop() {
|
||||
checkFloatingPointerRegions();
|
||||
gui_updateInput();
|
||||
|
||||
if (_updateHandItemCursor) {
|
||||
_updateHandItemCursor = false;
|
||||
setHandItem(_itemInHand);
|
||||
}
|
||||
|
||||
update();
|
||||
|
||||
if (_sceneUpdateRequired)
|
||||
|
@ -311,7 +311,7 @@ Common::Error KyraEngine_HoF::loadGameState(int slot) {
|
||||
_mainCharacter.facing = 4;
|
||||
|
||||
enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1);
|
||||
setHandItem(_itemInHand);
|
||||
setDelayedCursorUpdate();
|
||||
|
||||
if (_lastMusicCommand >= 0 && !_unkSceneScreenFlag1)
|
||||
snd_playWanderScoreViaMap(_lastMusicCommand, 1);
|
||||
|
@ -176,7 +176,7 @@ Common::Error KyraEngine_LoK::loadGameState(int slot) {
|
||||
_screen->copyRegion(8, 8, 8, 8, 304, 212, 10, 0);
|
||||
}
|
||||
|
||||
setHandItem(_itemInHand);
|
||||
setDelayedCursorUpdate();
|
||||
|
||||
// Will-O-Wisp uses a different shape size than Brandon's usual
|
||||
// shape, thus we need to setup the correct size depending on
|
||||
|
@ -263,7 +263,7 @@ Common::Error LoLEngine::loadGameState(int slot) {
|
||||
int t = _credits;
|
||||
_credits = 0;
|
||||
giveCredits(t, 0);
|
||||
setHandItem(_itemInHand);
|
||||
setDelayedCursorUpdate();
|
||||
loadLevel(_currentLevel);
|
||||
gui_drawPlayField();
|
||||
timerSpecialCharacterUpdate(0);
|
||||
|
@ -308,7 +308,7 @@ Common::Error KyraEngine_MR::loadGameState(int slot) {
|
||||
_goodConsciencePosition = false;
|
||||
|
||||
enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1);
|
||||
setHandItem(_itemInHand);
|
||||
setDelayedCursorUpdate();
|
||||
|
||||
if (_lastMusicCommand >= 0 && !_unkSceneScreenFlag1)
|
||||
snd_playWanderScoreViaMap(_lastMusicCommand, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user