mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-31 01:20:23 +00:00
Fix ReferenceInterface not resetting the Ptr after it was deleted, causing onReferenceUnavailable to be called every frame. Fix inputmanager hiding the cursor when it shouldn't.
This commit is contained in:
parent
1a2daa3bc1
commit
8fd961bbac
@ -26,7 +26,10 @@ namespace MWGui
|
|||||||
// check if player has changed cell, or count of the reference has become 0
|
// check if player has changed cell, or count of the reference has become 0
|
||||||
if ((playerCell != mCurrentPlayerCell && mCurrentPlayerCell != NULL)
|
if ((playerCell != mCurrentPlayerCell && mCurrentPlayerCell != NULL)
|
||||||
|| mPtr.getRefData().getCount() == 0)
|
|| mPtr.getRefData().getCount() == 0)
|
||||||
|
{
|
||||||
|
mPtr = MWWorld::Ptr();
|
||||||
onReferenceUnavailable();
|
onReferenceUnavailable();
|
||||||
|
}
|
||||||
|
|
||||||
mCurrentPlayerCell = playerCell;
|
mCurrentPlayerCell = playerCell;
|
||||||
}
|
}
|
||||||
|
@ -372,26 +372,11 @@ namespace MWInput
|
|||||||
void InputManager::changeInputMode(bool guiMode)
|
void InputManager::changeInputMode(bool guiMode)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->setMouseVisible(guiMode);
|
MWBase::Environment::get().getWindowManager()->setMouseVisible(guiMode);
|
||||||
if(guiMode)
|
mGuiCursorEnabled = guiMode;
|
||||||
{
|
mMouseLookEnabled = !guiMode;
|
||||||
// Disable mouse look
|
if (guiMode)
|
||||||
mMouseLookEnabled = false;
|
mWindows.showCrosshair(false);
|
||||||
|
// if not in gui mode, the camera decides whether to show crosshair or not.
|
||||||
mWindows.showCrosshair (false);
|
|
||||||
|
|
||||||
// Enable GUI events
|
|
||||||
mGuiCursorEnabled = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Enable mouse look
|
|
||||||
mMouseLookEnabled = true;
|
|
||||||
|
|
||||||
mWindows.showCrosshair (false);
|
|
||||||
|
|
||||||
// Disable GUI events
|
|
||||||
mGuiCursorEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputManager::processChangedSettings(const Settings::CategorySettingVector& changed)
|
void InputManager::processChangedSettings(const Settings::CategorySettingVector& changed)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user