File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
addons/source-python/packages/source-python/players Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -723,8 +723,7 @@ def secondary(self):
723
723
"""
724
724
return self .get_weapon (is_filters = 'secondary' )
725
725
726
- @property
727
- def active_weapon (self ):
726
+ def get_active_weapon (self ):
728
727
"""Return the player's active weapon.
729
728
730
729
:return: None if the player does not have an active weapon.
@@ -737,6 +736,15 @@ def active_weapon(self):
737
736
738
737
return Weapon (index )
739
738
739
+ def set_active_weapon (self , weapon ):
740
+ """Set the player's active weapon.
741
+
742
+ :param Weapon weapon: The weapon to set as active.
743
+ """
744
+ self .active_weapon_handle = weapon .inthandle
745
+
746
+ active_weapon = property (get_active_weapon , set_active_weapon )
747
+
740
748
def get_weapon (self , classname = None , is_filters = None , not_filters = None ):
741
749
"""Return the first found weapon for the given arguments.
742
750
You can’t perform that action at this time.
0 commit comments