View Single Post
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 07-23-2016 , 05:04   Re: [TF2] Healing a scout changes speed.
Reply With Quote #8

Quote:
Originally Posted by pheadxdll View Post
Had to disable the speed boost for stop that tank. Here's what I know for those interested.

The relevant part of code is in: TeamFortress_CalculateMaxSpeed. It checks to see if you're a medic and that your active weapon is a medigun. Then it validates m_hHealingTarget on the medigun and then calls itself to get the target's speed.

If you want to disable it for everyone, a simple memory patch will suffice. The healing speed boost is not client predicted so the client won't notice a thing. If you want to disable it for certain players, I think you have to detour the function. Shimming the player's speed with attributes won't work because the above function will choose the greater speed of the heal target. See the github for an example. Unfortunately, I don't see a better way. An attribute to toggle this functionality as suggested would be ideal but I fear the TF team is too busy putting out fires.

An easy but messy way: You could manually override m_flMaxspeed on the medic while healing. You'd have write your own speed calculation code that takes into account the movement attributes and other game conditions . I'm not sure how well this will look as the game will be continuously changing m_flMaxspeed while the player is healing (set in PostThink?). I haven't gone down that road.
Too busy porting community content for the next shameless moneygrab patch.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline