alliedmodders/sourcemod — pull request #42 by psychonic (2014-06-20 03:31:01+00:00)
Title: Switch TF2 extension to hook CTFGameRules::IsHolidayActive for holiday forward (bug 6137).

As noted on bug 6137, some of the calls to TF_IsHolidayActive that we detour on TF2 are now inlined on Windows, hampering functionality.

Instead, we can hook the virtual CTFGameRules::IsHolidayActive. There may be a case or two that bypass this function, going directly to the former one, but we are already missing those and more on Windows right now.

I tested a couple of things that can be done with the TF2_OnIsHolidayActive forward such as equipping holiday-restricted wearables, holiday taunts, and holiday-themed ammo boxes. These all work fine.

As a bonus, our automated bot will still alert us of changes, but also now giving the fixed offset if broken, rather than us manually having to dig through the binary to find the new byte signature on Windows.

@asherkin or @VoiDeD care to review code?

@FlaminSarge @powerlord comments regarding functionality?