View Single Post
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 10-22-2018 , 14:02   Re: [TF2] Medigun healing enemy players help
Reply With Quote #2

So, after pondering over this issue, i finally found what i did wrong.
I was returning from the CWeaponMedigun::AllowedToHealTarget function using ret, but the function uses the _stdcall calling convention and it accepted one parameter, the problem was that the callee should clear the stack before returning from the function, but in my case ret doesn't clean the stack and who knows how my server didn't manage to crash even with broken stack(magic?). So to fix the issue and make mediguns heal every player, i replaced ret instruction with ret 4, so it will clean the stack before returning and IT WORKED! I can now heal the enemy team, too. Not only this, now i can heal every entity, like sentries. No need to mess with CMedigunFilter::ShouldHitEntity Actually, let me show you what shit happened:

Healing enemy players:


Healin' sentries...:
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 10-22-2018 at 14:04.
Naydef is offline