Skip to content

Conversation

@ELDment
Copy link
Contributor

@ELDment ELDment commented Dec 27, 2025

#1151
#1151 (comment)

this pr fixes the crash on windows at least, linux is untested

00145a87-3fdc-48c4-b2ed-28aa66fdaddd

Root cause:

CS# hooks CBaseEntity_TakeDamageOld at startup, but CS2Fixes needs to hook it too, since CS# loads before CS2Fixes, once CS# hooks the function, CS2Fixes can no longer find the original signature in memory (leading to errors)

Fix:

we now only cache the memory address of CBaseEntity_TakeDamageOld during CS# startup, then defer the actual hook until all Metamod plugins have finished loading

@ELDment ELDment requested a review from roflmuffin as a code owner December 27, 2025 04:01
@roflmuffin
Copy link
Owner

This looks good to me. Could we remove the commented out code from the old file and then I'll merge?

@ELDment
Copy link
Contributor Author

ELDment commented Dec 27, 2025

This looks good to me. Could we remove the commented out code from the old file and then I'll merge?

updated

@ELDment
Copy link
Contributor Author

ELDment commented Dec 27, 2025

Side note:

possibly related to #1148 as well, not sure

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.

2 participants