FortyTwoFortyTwo / Randomizer

TF2 plugin that randomizes player loadout in any imaginable combinations
GNU General Public License v3.0
35 stars 15 forks source link

Buffalo Steak Sandvich mini-crit boost is too short #41

Closed doomy64 closed 3 years ago

doomy64 commented 4 years ago

The mini-crit boost from the steak lasts a little under half as long as it should, despite the melee only effect lasting for the full duration. This even happens as heavy.

doomy64 commented 3 years ago

This issue seems to be caused by UpdateEnergyDrinkMeter. Returning MRES_Supercede in a pre-hook fixes this, although would prevent soda popper hype from draining. Might be best to also hook CTFPlayerShared::RemoveCond as well.

If you want to experiment yourself, here's the signatures for UpdateEnergyDrinkMeter "linux" "@_ZN15CTFPlayerShared22UpdateEnergyDrinkMeterEv" "windows" "\x55\x8B\xEC\x83\xEC\x0C\x57\x8B\xF9\x6A\x01"

FortyTwoFortyTwo commented 3 years ago

I think we can avoid hooking possibly-expensive CTFPlayerShared::RemoveCond by changing m_nPlayerCond netprop while inside CTFPlayerShared::UpdateEnergyDrinkMeter. Still won't be easy to fix but i'll take a look at it.

FortyTwoFortyTwo commented 3 years ago

This fix is simpler than I thought, don't need CTFPlayerShared::UpdateEnergyDrinkMeter and cond hackery.