Skip to content

Commit 9669960

Browse files
committed
Fixed an oopsie (l4d2_fix_tank_rock_handoff)
Thanks to Alan for reminding me to double check what I ship 😅
1 parent 1297ce1 commit 9669960

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

-43 Bytes
Binary file not shown.

addons/sourcemod/scripting/l4d2_fix_tank_rock_handoff.sp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,29 @@ public void OnPluginStart()
4343
/* Covers Player to Player passes (including forced) */
4444
public void L4D_OnReplaceTank(int oldTank, int newTank)
4545
{
46-
CancelTankThrow(newTank);
46+
CancelPossibleTankThrow(newTank);
4747
}
4848

4949
/* Covers Player to Bot passes */
5050
void Event_PlayerBotReplace(Event event, const char[] name, bool dontBroadcast)
5151
{
5252
int bot = GetClientOfUserId(event.GetInt("bot"));
53-
54-
if (bot > 0 && IsTank(bot))
55-
CancelTankThrow(bot);
53+
CancelPossibleTankThrow(bot);
5654
}
5755

5856
/* Covers Bot to Player passes (as we do in some plugins) */
5957
void Event_BotPlayerReplace(Event event, const char[] name, bool dontBroadcast)
6058
{
6159
int player = GetClientOfUserId(event.GetInt("player"));
62-
63-
if (player > 0 && IsTank(player))
64-
CancelTankThrow(player);
60+
CancelPossibleTankThrow(player);
6561
}
6662

67-
void CancelTankThrow(int tank)
63+
void CancelPossibleTankThrow(int client)
6864
{
69-
if (!IsTank(tank))
65+
if (!IsTank(client))
7066
return;
7167

72-
int ability = GetEntPropEnt(tank, Prop_Send, "m_customAbility");
68+
int ability = GetEntPropEnt(client, Prop_Send, "m_customAbility");
7369
if (ability == -1)
7470
return;
7571

0 commit comments

Comments
 (0)