The class is not completely updated to use new conversion functions. I'm talking about this update: http://forums.sourcepython.com/showthread.php?991-Updated-conversion-functions&p=6402&viewfull=1#post6402
Some parts of it still use outdated calls to these functions. Take a look at get_weapon_color and set_weapon_color:
# Get the weapon's BaseHandle instance
index = index_from_inthandle(handle)
# Was no index found?
if index is None:
# Raise an error
raise ValueError(
'No active weapon found for player "{0}"'.format(self.userid))
If the active weapon is already dropped and there're no more valid weapons on player, index_from_inthandle will raise an exception. It won't return None.
As a result, instead of getting
ValueError: No active weapon found for player "2"
we will get
ValueError: Unable to get an index from the given IntHandle (-1)
The comment is also misleading. We're getting an index there, not BaseHandle instance.
The class is not completely updated to use new conversion functions. I'm talking about this update: http://forums.sourcepython.com/showthread.php?991-Updated-conversion-functions&p=6402&viewfull=1#post6402
Some parts of it still use outdated calls to these functions. Take a look at
get_weapon_colorandset_weapon_color:If the active weapon is already dropped and there're no more valid weapons on player,
index_from_inthandlewill raise an exception. It won't returnNone.As a result, instead of getting
ValueError: No active weapon found for player "2"we will get
ValueError: Unable to get an index from the given IntHandle (-1)The comment is also misleading. We're getting an index there, not BaseHandle instance.