Skip to content

Commit

Permalink
Fix: lastinv knife deploying (#117)
Browse files Browse the repository at this point in the history
* fix: Save player last weapon used even suicide

* fix: reset last weapon on weapons giving
  • Loading branch information
wopox1337 authored Apr 23, 2024
1 parent 9bb44ab commit 6e7a275
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cstrike/addons/amxmodx/scripting/ReDeathmatch.sma
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ public CSGameRules_PlayerKilled_Post(const victim, const killer, const inflictor
if (!SV_IsPlayerIndex(killer))
return

EquipManager_PlayerKilled(victim)
if (killer == victim)
return

Features_PlayerKilled(victim, killer)
EquipManager_PlayerKilled(victim)
}

public CvarChange_redm_active(const cvar, const oldValue[], const value[]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,11 @@ static bool: Player_GiveWeapon(const player, const EquipType_e: section) {
charsmax(weaponName)
)

rg_give_item(player, weaponName, .type = GT_REPLACE)
new item = rg_give_item(player, weaponName, .type = GT_REPLACE)

// Reset last item
set_member(player, m_pLastItem, item)

return true
}

Expand Down

0 comments on commit 6e7a275

Please sign in to comment.