Tsuey / L4D2-Community-Update

Help us shape the potential future of L4D2 vanilla.
71 stars 23 forks source link

Carriable props don't play limpwalk animations. #402

Open CubaOfficial opened 1 year ago

CubaOfficial commented 1 year ago

Description

This is a legacy bug from L4D1, all carriable props will not play their respective limp walking animation despite it being present in the animations. These work completely fine if forced to play via plugin, and I can only assume the activities were not set up correctly due to an oversight. Ellis and Coach have their own unique gascan limpwalk movement that suggests Valve themselves didn't even realize it was bugged.

All that's required to correct this is ensure that instead of ACT_WALK_XXX, ACT_WALK_INJURED_XXX is set to play instead like every other weapon and item.

How it current behaves in both L4D1 and L4D2

https://github.com/Tsuey/L4D2-Community-Update/assets/19815283/843e1922-054a-4e4b-b390-e3fc9af29f2d

And here with it functioning as intended

https://github.com/Tsuey/L4D2-Community-Update/assets/19815283/29f3c854-6153-4f33-84ee-a43d6c054580

Reproduction steps

Lower your HP to 39 or below and walk around with a gascan or o2 tank.

Additional files

No response

Shadowysn commented 1 year ago

How did you fix this in the clips? Would this need a C++ side fix?

CubaOfficial commented 1 year ago

I used sourcemod to fix it. Certain it would need a C++side fix.

Nothing crazy, my code just looked something like this:

if(StrEqual(sWeaponName, "weapon_gascan") > 0)
{
    if ((sequence == GetAnimation(client, "ACT_WALK_GASCAN")) && (GetClientRealHealth(client) < 40) )
    {
        DHookSetReturn(hReturn, GetAnimation(client, "ACT_WALK_INJURED_GASCAN"));
        return MRES_Override;
    }
}