sourcemod
sourcemod copied to clipboard
TF2_OnIsHolidayActive does not catch all cases
Many years ago, #42 changed the TF2_OnIsHolidayActive
forward from a TF_IsHolidayActive
detour to a CTFGameRules::IsHolidayActive
virtual hook.
I'm not quite sure how these functions looked like back then, but the current behavior of the TF2_OnIsHolidayActive
forward is most certainly wrong. TF2 has direct calls to TF_IsHolidayActive
all over game code, meaning that the forward does not get called for these invocations.
However, CTFGameRules::IsHolidayActive
directly calls TF_IsHolidayActive
, meaning that this can be fixed without breaking anything in the process by changing the forward to the signature call (again).
This was an intentional trade off, the reasoning is given in the linked PR.
We could do both, but that would result in differing behaviour between Windows and Linux which I think would be much worse.
the reasoning is given in the linked PR
If this is about it being inlined; it's not. At least not anymore. The function was expanded over the years.
Here are the current signatures:
Linux: @_Z18TF_IsHolidayActivei
Windows: \x55\x8B\xEC\xA1\x2A\x2A\x2A\x2A\x83\x78\x30\x00\x74\x2A\x32\xC0
I agree, with that explanation, switching back seems reasonable.
does hooking multiple vtables here help? or is it really that direct on the call