Skip to content

Commit

Permalink
Fix for build 37500
Browse files Browse the repository at this point in the history
  • Loading branch information
3vcloud committed Nov 13, 2024
1 parent a5d5e40 commit 25c76dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dependencies/GWCA
Submodule GWCA updated from eaf434 to baa7dd
15 changes: 10 additions & 5 deletions GWToolboxdll/Modules/MouseFix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ namespace {
// Force redraw
const auto user_data = (GWWindowUserData*)GetWindowLongA(GW::MemoryMgr::GetGWWindowHandle(), -0x15);
current_cursor = nullptr;
if (user_data) {
OnChangeCursorIcon(user_data);
if (user_data && ChangeCursorIcon_Func) {
ChangeCursorIcon_Func(user_data);
}
});
}
Expand Down Expand Up @@ -351,13 +351,18 @@ void MouseFix::Initialize()
{
ToolboxModule::Initialize();

const uintptr_t address = GW::Scanner::Find("\x8b\x41\x08\x89\x82\x50\x0c\x00\x00", "xxxxxxxxx", 0x9);
ChangeCursorIcon_Func = (ChangeCursorIcon_pt)GW::Scanner::FunctionFromNearCall(address);
if (ChangeCursorIcon_Func) {
auto address = GW::Scanner::Find("\xf7\xc3\x80\x20\x00\x00\x74\x09\x56", "xxxxxxxxx", 0x9);
address = GW::Scanner::FunctionFromNearCall(address);
if (GW::Scanner::IsValidPtr(address,GW::Scanner::TEXT)) {
ChangeCursorIcon_Func = (ChangeCursorIcon_pt)address;
GW::HookBase::CreateHook((void**)&ChangeCursorIcon_Func, OnChangeCursorIcon, (void**)&ChangeCursorIcon_Ret);
GW::HookBase::EnableHooks(ChangeCursorIcon_Func);
}

#if _DEBUG
ASSERT(ChangeCursorIcon_Func);
#endif

const GW::UI::UIMessage ui_messages[] = {
GW::UI::UIMessage::kLogout,
GW::UI::UIMessage::kMapLoaded
Expand Down

0 comments on commit 25c76dc

Please sign in to comment.