Skip to content

Fix TF2_OnIsHolidayActive forward not getting called after map change#1752

Merged
peace-maker merged 2 commits intoalliedmodders:masterfrom
Mikusch:holiday-fix
Apr 22, 2022
Merged

Fix TF2_OnIsHolidayActive forward not getting called after map change#1752
peace-maker merged 2 commits intoalliedmodders:masterfrom
Mikusch:holiday-fix

Conversation

@Mikusch
Copy link
Contributor

@Mikusch Mikusch commented Apr 20, 2022

Fixes #1747

After a map change, the virtual hook on IsHolidayActive will be invalid due to the gamerules object being destroyed, but current code does not attempt to hook it again if a plugin using the TF2_OnIsHolidayActive forward is still loaded.

Always unhook on level change, and check for plugins using the forward only in HolidayManager::OnPluginUnloaded.

@peace-maker
Copy link
Member

Maybe it's better to just call the function Unhook now that it always does that.

@Mikusch
Copy link
Contributor Author

Mikusch commented Apr 20, 2022

Maybe it's better to just call the function Unhook now that it always does that.

I agree. Done.

@peace-maker peace-maker changed the title Fix TF2_IsHolidayActive forward not getting called after map change Fix TF2_OnIsHolidayActive forward not getting called after map change Apr 20, 2022
@peace-maker peace-maker merged commit a1ad9e1 into alliedmodders:master Apr 22, 2022
@Mikusch Mikusch deleted the holiday-fix branch April 22, 2022 09:57
asherkin pushed a commit that referenced this pull request May 4, 2022
…#1752)

* Fix TF2_IsHolidayActive forward not getting called after map change

* Rename function to Unhook
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.

TF2_OnIsHolidayActive forward does not get called anymore after a map change

2 participants