Skip to content

Commit

Permalink
mvm attributes: Validity check for weapon change
Browse files Browse the repository at this point in the history
  • Loading branch information
nosoop committed Oct 24, 2023
1 parent b4bbca6 commit 7f4c49d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripting/mvm_attributes.sp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ void OnClientWeaponSwitchPost(int client, int weapon) {
TF2_RemoveCondition(client, TFCond_CritOnKill);
}

if (!IsValidEntity(weapon)) {
return;
}

// vaccinator: preset resist type
// note: it doesn't matter if this is actually the active weapon
int itemdef = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
if (itemdef == 998 & g_iMvMFlags[client] & MVMATTR_VACCINATOR_FORCE) {
// TODO block CWeaponMedigun::CycleResistType
Expand Down

0 comments on commit 7f4c49d

Please sign in to comment.