Skip to content

Commit

Permalink
udm.on_pre_bump_weapon(): Fix checking for intenvory selections
Browse files Browse the repository at this point in the history
Signed-off-by: BackRaw <backraw@gmx.de>
  • Loading branch information
BackRaw committed Nov 16, 2017
1 parent 92339d1 commit 02b70ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/source-python/plugins/udm/udm.py
Expand Up @@ -222,7 +222,10 @@ def on_pre_bump_weapon(stack_data):
weapon_data = weapon_manager.by_name(weapon.weapon_name)

# Block bumping if the weapon is not listed in the player's inventory
if weapon_data is not None and weapon_data.tag in player.inventory:
if weapon_data is not None:
if weapon_data.tag not in player.inventory:
return False

weapon_selected = player.inventory[weapon_data.tag].data.name

if weapon_selected not in (weapon.weapon_name, weapon.classname):
Expand Down

0 comments on commit 02b70ee

Please sign in to comment.