Skip to content

Commit dbbec76

Browse files
committed
Improve mouse click blocking
1 parent d09f491 commit dbbec76

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

SharpPluginLoader.Core/Rendering/Renderer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,15 @@ Initializing Renderer with
265265

266266
_mouseUpdateHook.Original(m);
267267

268-
// Block mouse clicks if an ImGui window is hovered. Use _lastUpdateHadFocus
268+
// Block mouse1 clicks if an ImGui window is hovered. Use _lastUpdateHadFocus
269269
// to more consistently block a click used to unfocus the ImGui window.
270270
var anyHovered = ImGui.IsWindowHovered(ImGuiHoveredFlags.AnyWindow);
271271
if (anyHovered || _lastUpdateHadFocus)
272272
{
273273
unsafe
274274
{
275-
*(byte*)(m + 0x188) = 0;
275+
*(byte*)(m + 0x108) &= 0xFE; // Combat.
276+
*(byte*)(m + 0x188) &= 0xFE; // Menus.
276277
}
277278
_lastUpdateHadFocus = false;
278279
}

0 commit comments

Comments
 (0)