Skip to content

Fix funcidx in the streamer plugin. - #552

Merged
AmyrAhmady merged 1 commit into
masterfrom
streamer-pr
Dec 29, 2022
Merged

AmyrAhmady merged 1 commit into
masterfrom
streamer-pr

Conversation

@Y-Less

@Y-Less Y-Less commented Dec 28, 2022

Copy link
Copy Markdown
Collaborator

samp-gdk hooks funcidx to inject its own version. It does this by just writing straight to the pointer in the header, which is then seen here as a double-registered pointer. However, it has a bug as well, in that it only hooks the first instance of funcidx, when there can be more with external native names. So this code, while it isn't really our job, fixes both those issues.

The code special-cases funcidx in amx_Register, and explicitly caches and sets the funcidx function pointer. This means if it is set already by samp-gdk then that pointer will be copied to all instances of the native, and the standard lookup code won't be entered.

@AmyrAhmady
AmyrAhmady merged commit f55196e into master Dec 29, 2022
@AmyrAhmady
AmyrAhmady deleted the streamer-pr branch December 29, 2022 07:34
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.

3 participants