-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
I noticed player.take_damage causes errors in windows and it makes linux server crash, i am running the latest version of SP.
here is the error on windows:
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\packages\source-python\events\listener.py", line 92, in fire_game_event
callback(game_event)
~~~~~~~~^^^^^^^^^^^^
File "..\addons\source-python\plugins\test\test.py", line 10, in player_hurt
victim.take_damage(damage=123, attacker_index=index_from_userid(attacker))
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "..\addons\source-python\packages\source-python\entities\_base.py", line 816, in take_damage
self.on_take_damage(take_damage_info)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "..\addons\source-python\packages\source-python\memory\helpers.py", line 337, in __call__
return super().__call__(self._this, *args)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
RuntimeError: Access violation while reading address '0'.
Here is test code:
from events import Event
from players.entity import Player
from players.helpers import index_from_userid
@Event('player_hurt')
def player_hurt(args):
victim = Player.from_userid(args['userid'])
attacker = args.get_int('attacker')
if attacker > 0:
victim.take_damage(damage=123, attacker_index=index_from_userid(attacker))Metadata
Metadata
Assignees
Labels
No labels