Raised This Month: $ Target: $400
 0% 

[TF2] Prevent medigun/dispenser healing issues with SetTransmit hook


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The Great Weegee
Member
Join Date: Dec 2017
Location: vsh_egyptyspot_b4
Old 06-03-2022 , 17:06   [TF2] Prevent medigun/dispenser healing issues with SetTransmit hook
Reply With Quote #1

Can somebody help me?

I have a plugin which can stop transmitting players during the round (move them into "another world") and hide them from teammates - however, when I'm doing this kind of thing with medics who are actively healing another player, player still gains health and overheal as if medic heals him.
Moreover, he continues to get healing even if he respawns or moves back from "another world" and even when medic starts healing him again, so it kind of "stacks". How this can be fixed?

Asking for dispensers too because I feel any kind of continous healing still will be an issue.
__________________
The Great Weegee is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 06-07-2022 , 06:55   Re: [TF2] Prevent medigun/dispenser healing issues with SetTransmit hook
Reply With Quote #2

One way would be to hook and return false on both CWeaponMedigun::AllowedToHealTarget and CObjectDispenser::CouldHealTarget if neither object share the same space.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
The Great Weegee
Member
Join Date: Dec 2017
Location: vsh_egyptyspot_b4
Old 06-07-2022 , 07:22   Re: [TF2] Prevent medigun/dispenser healing issues with SetTransmit hook
Reply With Quote #3

Thank you!
Tried fiddling with DHook returns on that matter - should I return MRES_ChangedOverride though?
__________________
The Great Weegee is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 06-07-2022 , 08:25   Re: [TF2] Prevent medigun/dispenser healing issues with SetTransmit hook
Reply With Quote #4

I'd go with a pre-hook and returning MRES_Supercede since there's no point in running the game's function if your checks pass (if they don't pass, let the game run its checks with MRES_Ignored).
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
The Great Weegee
Member
Join Date: Dec 2017
Location: vsh_egyptyspot_b4
Old 06-07-2022 , 08:28   Re: [TF2] Prevent medigun/dispenser healing issues with SetTransmit hook
Reply With Quote #5

Thank you so much for your help!
__________________
The Great Weegee is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:38.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode