AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2]Charger_Collision_patch[Left 4 Fix][05/03/2024] (https://forums.alliedmods.net/showthread.php?t=315482)

Lux 04-10-2019 15:49

[L4D2]Charger_Collision_patch[Left 4 Fix][05/03/2024]
 
1 Attachment(s)
Charger Collision patch apart of Left 4 Fix.
https://github.com/LuxLuma/Left-4-fix

Huge thanks to silvers in helping me learn alot of stuff about disassembly, IDA, memory patching and finding windows signatures.

Charger_Collision_patch
Fixes charging only allowing to hit 1 of each survivor character index and allows charger smashing into the same survivor more than once, survivors no longer become a brick wall after being charger smashed once, damage should only be delt once per survivor per charge.



Requirements:

Source Scramble (memory patching and allocation natives)

Installation:

1.Download the .zip file.
2.Merge with \addons\sourcemod\ folder.
3.Restart the server.

TrueSurvivor 04-30-2019 23:33

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Neat plugin idea, everything looked in order so I decided to run it on the Servers for a day and I came across this issue (Twitch Clip)

When glancing over the source code it should prevent the damage just fine, could it be possible that m_carryVictim is changed briefly upon charger_impact?

Lux 05-01-2019 00:06

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Hmm i tested this problem alot and thought i fixed it, ill try and replicate it and see what happens, also a note do you use this plugin?

https://forums.alliedmods.net/showth...27934?t=127934

TrueSurvivor 05-01-2019 00:17

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Quote:

Originally Posted by Lux (Post 2649532)
Hmm i tested this problem alot and thought i fixed it, ill try and replicate it and see what happens, also a note do you use this plugin?

https://forums.alliedmods.net/showth...27934?t=127934

Yes, I am.
I didn't even stop to think that OnTakeDamage calls can interfere with one another, it's a likely cause, especially as I've had to deal with this in the past. :oops:

Lux 05-01-2019 00:19

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Ok noproblem that makes testing for me easier, if that plugin is the reason why it is happening, i'm unsure if ill be able to work around and would have to leave a note on the plugin thread.

Lux 05-01-2019 00:38

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Alright that godframes plugin does not conflict with this plugin regardless of load order,
did you by any chance load the plugin mid game?

TrueSurvivor 05-01-2019 01:22

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
Quote:

Originally Posted by Lux (Post 2649541)
Alright that godframes plugin does not conflict with this plugin regardless of load order,
did you by any chance load the plugin mid game?

No, the plugin was loaded and the map got restarted.
It's also the first plugin that uses OnTakeDamage (order-wise) that gets loaded.

Lux 05-01-2019 01:47

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
I have no idea what could cause this, most likely a conflict somewhere causing my checks to fail.

Try doing this
PHP Code:

public Action BlockRecursiveDamage(int iVictimint &iChargerint &iInflictorfloat &fDamageint &iDamagetype)
{
    if(
GetClientTeam(iVictim) != 2)
        return 
Plugin_Continue;
    
    if(
iCharger || iCharger MaxClients || 
        
GetClientTeam(iCharger) != || !IsPlayerAlive(iCharger) || 
        
GetEntProp(iChargerProp_Send"m_zombieClass"1) != )
        return 
Plugin_Continue;
    
    
int iAbility GetEntPropEnt(iChargerProp_Send"m_customAbility");
    if(
iAbility <= MaxClients || !HasEntProp(iAbilityProp_Send"m_isCharging"))
        return 
Plugin_Continue;
    
    if(
GetEntProp(iAbilityProp_Send"m_isCharging"1))
    {
        if(
GetEntPropEnt(iVictimProp_Send"m_carryAttacker") == iCharger &&
            
GetEntPropEnt(iChargerProp_Send"m_carryVictim") == iVictim)
            return 
Plugin_Continue;
            
        if(
g_fPreventDamage[iCharger][iVictim] > GetEngineTime())
            return 
Plugin_Handled;
        
        
g_fPreventDamage[iCharger][iVictim] = GetEngineTime() + 0.5;
    }
    return 
Plugin_Continue;


Creating an block in the damage hook for next collision if this don't work i'v no idea how to help you.

Besure to restart server.

Quote:

Originally Posted by TrueSurvivor (Post 2649544)
could it be possible that m_carryVictim is changed briefly upon charger_impact?

Not that i know of.

eyal282 05-01-2019 11:40

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
THANK YOU!!!

Spirit_12 05-02-2019 02:52

Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
 
From your explanation it seems like a straight up port of the extension as opposed to a new fix. Does it do anything different than the bugfix extension?


All times are GMT -4. The time now is 00:58.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.