Raised This Month: $ Target: $400
 0% 

[L4D2]Charger_Collision_patch[Left 4 Fix][05/03/2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Plugin ID:
6511
Plugin Version:
2.0
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    447 
    Plugin Description:
    Fixes crappy charger.
    Old 04-10-2019 , 16:49   [L4D2]Charger_Collision_patch[Left 4 Fix][05/03/2024]
    Reply With Quote #1

    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.

    Spoiler


    Requirements:

    Source Scramble (memory patching and allocation natives)

    Installation:

    1.Download the .zip file.
    2.Merge with \addons\sourcemod\ folder.
    3.Restart the server.
    Attached Files
    File Type: zip Charger_Collision_patch.zip (18.3 KB, 887 views)
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D

    Last edited by Lux; 03-05-2024 at 05:11. Reason: update 2.0.1
    Lux is offline
    TrueSurvivor
    Member
    Join Date: Jun 2010
    Old 05-01-2019 , 00:33   Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
    Reply With Quote #2

    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?
    TrueSurvivor is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 05-01-2019 , 01:06   Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
    Reply With Quote #3

    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
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    TrueSurvivor
    Member
    Join Date: Jun 2010
    Old 05-01-2019 , 01:17   Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
    Reply With Quote #4

    Quote:
    Originally Posted by Lux View Post
    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.
    TrueSurvivor is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 05-01-2019 , 01:19   Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
    Reply With Quote #5

    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.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 05-01-2019 , 01:38   Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
    Reply With Quote #6

    Alright that godframes plugin does not conflict with this plugin regardless of load order,
    did you by any chance load the plugin mid game?
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    TrueSurvivor
    Member
    Join Date: Jun 2010
    Old 05-01-2019 , 02:22   Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
    Reply With Quote #7

    Quote:
    Originally Posted by Lux View Post
    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.
    TrueSurvivor is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 05-01-2019 , 02:47   Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
    Reply With Quote #8

    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 View Post
    could it be possible that m_carryVictim is changed briefly upon charger_impact?
    Not that i know of.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D

    Last edited by Lux; 05-01-2019 at 02:51.
    Lux is offline
    eyal282
    Veteran Member
    Join Date: Aug 2011
    Old 05-01-2019 , 12:40   Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
    Reply With Quote #9

    THANK YOU!!!
    __________________
    I am available to make plugins for pay.

    Discord: Eyal282#1334
    eyal282 is offline
    Spirit_12
    Veteran Member
    Join Date: Dec 2012
    Location: Toronto, CA
    Old 05-02-2019 , 03:52   Re: [L4D2]Better_Charger_Collision+patch[Left 4 Fix]
    Reply With Quote #10

    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?
    __________________
    Spirit_12 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 07:13.


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