Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors from l4d2_magnum_incap #73

Merged
merged 1 commit into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified addons/sourcemod/plugins/optional/l4d2_magnum_incap.smx
Binary file not shown.
8 changes: 5 additions & 3 deletions addons/sourcemod/scripting/l4d2_magnum_incap.sp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public Plugin myinfo =
name = "Magnum incap remover",
author = "robex",
description = "Replace magnum with regular pistols when incapped.",
version = "0.2",
version = "0.3",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
};

Expand All @@ -39,10 +39,12 @@ public Action PlayerIncap_Event(Handle event, const char[] name, bool bDontBroad
}

int client = GetClientOfUserId(GetEventInt(event, "userid"));
int playerIndex = GetPlayerCharacter(client);

char sWeaponName[ENTITY_MAX_NAME_LENGTH];
// This also fires on Tank Death, so check for client team to prevent issues down the line.
if (GetClientTeam(client) != 2) { return Plugin_Continue; }

int playerIndex = GetPlayerCharacter(client);
char sWeaponName[ENTITY_MAX_NAME_LENGTH];
int secWeaponIndex = GetPlayerWeaponSlot(client, L4D2WeaponSlot_Secondary);
GetEdictClassname(secWeaponIndex, sWeaponName, sizeof(sWeaponName));

Expand Down