Target5150 / MoYu_Server_Stupid_Plugins

L4D2 Target Cat Project
GNU General Public License v3.0
85 stars 21 forks source link

Bug in l4d_tongue_block_fix #42

Closed nikita1824 closed 1 year ago

nikita1824 commented 1 year ago

Hello, installing l4d_tongue_block_fix plugin causes ai's smoker ability to be broken (smoker bots can't grab any survivor at all). I tried to filter bots in CH_PassFilter() to avoid plugin to interrupt in ai's ability behavior but it didn't help. Do you have any idea how to solve this problem?

jensewe commented 1 year ago

Not really remember there's difference in tongue chasing between bots and humans. And I cannot reproduce that one on my end. Would you like to share some footages, and if possible, double check with all other plugins unloaded?

nikita1824 commented 1 year ago

yeap, I'm not sure about other plugins here is video link: https://youtu.be/sy7g-fYeSp4

jensewe commented 1 year ago

If you don't mind, check out the following debug code and try again to see if there's anything strange?

Copy the following to the beginning of CH_PassFilter block

    static int lastHit = -1;
    if (lastHit != touch)
    {
        lastHit = touch;

        static char cls[64];
        if (pass > MaxClients)
        {
            if (!GetEdictClassname(pass, cls, sizeof(cls)))
                return Plugin_Continue;

            if (strcmp(cls, "ability_tongue") != 0)
                return Plugin_Continue;

            if (touch > 0 && touch <= MaxClients)
            {
                if (!GetClientName(touch, cls, sizeof(cls)))
                    return Plugin_Continue;
            }
            else if (!GetEdictClassname(touch, cls, sizeof(cls)))
                return Plugin_Continue;

            PrintToChatAll("[DEBUG] Tongue fly collision: %s", cls);
        }
    }
nikita1824 commented 1 year ago

Hello, I'm sorry for the late reply. Pattern of the bug has changed since the version 1.3 of the plugin. I don't know how to explain it. Here is the video link: https://youtu.be/K1sEax-2lqI From debug messages it's hard to tell what's wrong...

Upd: There is another thing, when I use this sourcescramble pattern of the bug changes. AI smokers cannot grab me when they are in the close distance but from mid/far distance there are no problems.

jensewe commented 1 year ago

Pushed a fix via pull request, tested on L4D2 Linux and looks fine on my end. Appreciate if you could help confirm :)

nikita1824 commented 1 year ago

Yeap, now it works fine, thanks a lot for the fix.