Skip to content

Fix CMenuManager::DrawQuitGameScreen signature - #328

Open
Akionka wants to merge 1 commit into
DK22Pac:masterfrom
Akionka:fix-draw-quit-game-screen-signature
Open

Fix CMenuManager::DrawQuitGameScreen signature#328
Akionka wants to merge 1 commit into
DK22Pac:masterfrom
Akionka:fix-draw-quit-game-screen-signature

Conversation

@Akionka

@Akionka Akionka commented Aug 21, 2026

Copy link
Copy Markdown

Removes the incorrect int unused parameter from CMenuManager::DrawQuitGameScreen.

The function at 0x57D860 in GTA SA 1.0 US uses ECX as this and ends with a plain:

ret

rather than:

ret 4

For an x86 __thiscall function, a single explicit 32-bit argument would be passed on the stack and cleaned up by the callee with ret 4, even if the argument itself was unused.

Therefore the function appears to have no explicit parameters.

Changed from:

void CMenuManager::DrawQuitGameScreen(int unused) {
    plugin::CallMethod<0x57D860, CMenuManager*>(this, unused);
}

to:

void CMenuManager::DrawQuitGameScreen() {
    plugin::CallMethod<0x57D860, CMenuManager*>(this);
}

This also avoids the stack/calling-convention mismatch caused by passing an argument to a function that does not clean it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant