Hook function for damage handling in the game. This function intercepts the call to deal damage and redirects it to a custom implementation while preserving the original behavior.
- Note
- This is a naked function, meaning it does not have standard prologue/epilogue generated by the compiler. All stack management and register saving/restoring must be handled manually in assembly.
- Pushes arguments from the stack for
sf_deal_damage
.
- Sets up the
ECX
register to the appropriate value.
- Calls
sf_deal_damage
.
- Modifies a value in the stack based on the result.
- Jumps back to the original return address stored in
g_damage_return_addr
.
- Warning
- This function is architecture-dependent (x86) and may not work on other platforms.
Definition at line 131 of file sf_damage_hook.c.