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...:
__________________