mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-21 11:39:44 +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
2 changed files with 8 additions and 20 deletions
|
@ -26,7 +26,10 @@ namespace MWGui
|
|||
// check if player has changed cell, or count of the reference has become 0
|
||||
if ((playerCell != mCurrentPlayerCell && mCurrentPlayerCell != NULL)
|
||||
|| mPtr.getRefData().getCount() == 0)
|
||||
{
|
||||
mPtr = MWWorld::Ptr();
|
||||
onReferenceUnavailable();
|
||||
}
|
||||
|
||||
mCurrentPlayerCell = playerCell;
|
||||
}
|
||||
|
|
|
@ -372,26 +372,11 @@ namespace MWInput
|
|||
void InputManager::changeInputMode(bool guiMode)
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->setMouseVisible(guiMode);
|
||||
if(guiMode)
|
||||
{
|
||||
// Disable mouse look
|
||||
mMouseLookEnabled = false;
|
||||
|
||||
mWindows.showCrosshair (false);
|
||||
|
||||
// Enable GUI events
|
||||
mGuiCursorEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Enable mouse look
|
||||
mMouseLookEnabled = true;
|
||||
|
||||
mWindows.showCrosshair (false);
|
||||
|
||||
// Disable GUI events
|
||||
mGuiCursorEnabled = false;
|
||||
}
|
||||
mGuiCursorEnabled = guiMode;
|
||||
mMouseLookEnabled = !guiMode;
|
||||
if (guiMode)
|
||||
mWindows.showCrosshair(false);
|
||||
// if not in gui mode, the camera decides whether to show crosshair or not.
|
||||
}
|
||||
|
||||
void InputManager::processChangedSettings(const Settings::CategorySettingVector& changed)
|
||||
|
|
Loading…
Reference in a new issue