File tree Expand file tree Collapse file tree
addons/source-python/packages/source-python/entities Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,21 +75,20 @@ def take_damage(
7575 # Try to get the attacker based off of the weapon's owner
7676 with suppress (ValueError ):
7777 attacker_index = index_from_inthandle (weapon .current_owner )
78- if attacker_index is not None :
79- attacker = Entity (attacker_index )
78+ attacker = Entity (attacker_index )
8079
8180 # Is there an attacker but no weapon?
8281 if attacker is not None and weapon is None :
8382
8483 # Does the attacker have a weapon attribute?
8584 if hasattr (attacker , 'active_weapon' ):
85+ with suppress (ValueError ):
8686
87- # Get the attacker's current weapon index
88- weapon_index = index_from_inthandle (
89- attacker .active_weapon , False )
87+ # Get the attacker's current weapon index
88+ weapon_index = index_from_inthandle (
89+ attacker .active_weapon )
9090
91- # Get the weapon's Weapon instance if it is valid
92- if weapon_index is not None :
91+ # Get the weapon's Weapon instance
9392 weapon = Weapon (weapon_index )
9493
9594 # Is hitgroup a valid attribute?
You can’t perform that action at this time.
0 commit comments