diff --git a/addons/sourcemod/plugins/optional/staggersolver.smx b/addons/sourcemod/plugins/optional/staggersolver.smx index ebdd36ff2..98a9e9584 100644 Binary files a/addons/sourcemod/plugins/optional/staggersolver.smx and b/addons/sourcemod/plugins/optional/staggersolver.smx differ diff --git a/addons/sourcemod/scripting/staggersolver.sp b/addons/sourcemod/scripting/staggersolver.sp index 7c1c5d356..734e01e5e 100644 --- a/addons/sourcemod/scripting/staggersolver.sp +++ b/addons/sourcemod/scripting/staggersolver.sp @@ -9,7 +9,7 @@ public Plugin myinfo = name = "Super Stagger Solver", author = "CanadaRox, A1m (fix), Sir (rework), Forgetest", description = "Blocks all button presses and restarts animations during stumbles", - version = "2.3", + version = "2.4", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -20,19 +20,56 @@ public void L4D_OnShovedBySurvivor_Post(int client, int victim, const float vecD public void L4D2_OnStagger_Post(int client, int source) { - // Interesting to note is that this might not be needed. - // Issues might be caused by other plugins messing with the current stagger/anim prior to Post. - // Do with this information what you want. - if (GetClientTeam(client) != 3) - return; + if (GetClientTeam(client) != 3) return; if (!L4D_IsPlayerStaggering(client)) return; - - if (IsTankThrowingRock(client)) // handled by plugin "rock_stumble_block" - return; - + PlayerAnimState anim = PlayerAnimState.FromPlayer(client); + if(IsTank(client)) + { + if (IsTankThrowingRock(client)) // handled by plugin "rock_stumble_block" + return; + + switch (anim.GetMainActivity()) + { + case L4D2_ACT_TERROR_HULK_VICTORY, + L4D2_ACT_TERROR_HULK_VICTORY_B, + L4D2_ACT_TERROR_RAGE_AT_ENEMY, + L4D2_ACT_TERROR_RAGE_AT_KNOCKDOWN: + { + SetEntPropFloat(client, Prop_Send, "m_flCycle", 1.0); + } + case L4D2_ACT_TERROR_CLIMB_24_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_36_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_48_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_50_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_60_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_70_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_72_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_84_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_96_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_108_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_115_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_120_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_130_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_132_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_144_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_150_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_156_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_166_FROM_STAND, + L4D2_ACT_TERROR_CLIMB_168_FROM_STAND: + { + return; + } + default: + { + anim.ResetMainActivity(); + } + } + + return; + } switch (anim.GetMainActivity()) { @@ -73,9 +110,6 @@ public Action OnPlayerRunCmd(int client, int &buttons) bool IsTankThrowingRock(int client) { - if (!IsTank(client)) - return false; - int ability = GetEntPropEnt(client, Prop_Send, "m_customAbility"); if (ability == -1) return false; @@ -85,14 +119,7 @@ bool IsTankThrowingRock(int client) bool IsTank(int client) { - static int s_iTankClass = -1; - if (s_iTankClass == -1) - { - s_iTankClass = L4D_IsEngineLeft4Dead() ? 5 : 8; - } - - return GetClientTeam(client) == 3 - && GetEntProp(client, Prop_Send, "m_zombieClass") == s_iTankClass; + return GetEntProp(client, Prop_Send, "m_zombieClass") == 8; } bool CThrow__IsActive(int ability) @@ -117,9 +144,6 @@ CountdownTimer CThrow__GetThrowTimer(int ability) bool CThrow__SelectingTankAttack(int ability) { - if (L4D_IsEngineLeft4Dead()) - return false; - static int s_iOffs_m_bSelectingAttack = -1; if (s_iOffs_m_bSelectingAttack == -1) s_iOffs_m_bSelectingAttack = FindSendPropInfo("CThrow", "m_hasBeenUsed") + 28;