Skip to content

Commit ed94f28

Browse files
committed
Update staggersolver
- Replace gamedata with Left4Dhooks dependency.
1 parent 17b887c commit ed94f28

3 files changed

Lines changed: 9 additions & 49 deletions

File tree

addons/sourcemod/gamedata/staggersolver.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.
1.41 KB
Binary file not shown.

addons/sourcemod/scripting/staggersolver.sp

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,25 @@
22
#pragma newdecls required
33

44
#include <sourcemod>
5-
#include <sdktools>
6-
7-
#define GAMEDATA_FILE "staggersolver"
8-
#define SIGNATURE_NAME "IsStaggering"
5+
#include <left4dhooks>
96

107
public Plugin myinfo =
118
{
129
name = "Super Stagger Solver",
13-
author = "CanadaRox, A1m (fix)",
10+
author = "CanadaRox, A1m (fix), Sir (rework)",
1411
description = "Blocks all button presses during stumbles",
15-
version = "1.1",
12+
version = "1.2",
1613
};
1714

18-
Handle g_hIsStaggering;
19-
20-
public void OnPluginStart()
21-
{
22-
Handle g_hGameConf = LoadGameConfigFile(GAMEDATA_FILE);
23-
if (g_hGameConf == INVALID_HANDLE) {
24-
SetFailState("[Stagger Solver] Could not load game config file '%s'.", GAMEDATA_FILE);
25-
}
26-
27-
StartPrepSDKCall(SDKCall_Player);
28-
29-
if (!PrepSDKCall_SetFromConf(g_hGameConf, SDKConf_Signature, SIGNATURE_NAME)) {
30-
SetFailState("[Stagger Solver] Could not find signature '%s' in gamedata.", SIGNATURE_NAME);
31-
}
32-
33-
PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
34-
g_hIsStaggering = EndPrepSDKCall();
35-
36-
if (g_hIsStaggering == INVALID_HANDLE) {
37-
SetFailState("[Stagger Solver] Failed to load signature '%s'", SIGNATURE_NAME);
38-
}
39-
40-
delete g_hGameConf;
41-
}
42-
4315
public Action OnPlayerRunCmd(int client, int &buttons)
4416
{
45-
if (IsClientInGame(client) && IsPlayerAlive(client) && SDKCall(g_hIsStaggering, client)) {
17+
if (IsClientInGame(client)
18+
&& IsPlayerAlive(client)
19+
&& L4D_IsPlayerStaggering(client))
20+
{
4621
/*
47-
* if you shoved the infected player with the butt while moving on the ladder,
48-
* he will not be able to move until he is killed
22+
* If you shove an SI that's on the ladder, the player won't be able to move at all until killed.
23+
* This is why we only apply this method when the SI is not on a ladder.
4924
*/
5025
if (GetEntityMoveType(client) != MOVETYPE_LADDER) {
5126
buttons = 0;

0 commit comments

Comments
 (0)