Skip to content

Commit 117f804

Browse files
authored
Fix showCursor not updating controls state when cursor already visible (#1034) (#4448)
* Improve cursor visibility handling in CResource::ShowCursor function
1 parent c71577b commit 117f804

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Client/mods/deathmatch/logic/CResource.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,11 @@ void CResource::ShowCursor(bool bShow, bool bToggleControls)
410410

411411
// Update our showing cursor state
412412
m_bShowingCursor = bShow;
413-
414-
// Show cursor if more than 0 resources wanting the cursor on
415-
g_pCore->ForceCursorVisible(m_iShowingCursor > 0, bToggleControls);
416-
g_pClientGame->SetCursorEventsEnabled(m_iShowingCursor > 0);
417413
}
414+
415+
// Always update cursor and controls state regardless of cursor visibility change
416+
g_pCore->ForceCursorVisible(m_iShowingCursor > 0, bToggleControls);
417+
g_pClientGame->SetCursorEventsEnabled(m_iShowingCursor > 0);
418418
}
419419

420420
SString CResource::GetResourceDirectoryPath(eAccessType accessType, const SString& strMetaPath)

0 commit comments

Comments
 (0)