Skip to content

Commit

Permalink
Add more safe-guards and use player_id as killer_id
Browse files Browse the repository at this point in the history
Looks like killer_id = 31 crashes OS
  • Loading branch information
godwhoa committed Jan 7, 2018
1 parent 92b281d commit b56332e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyspades/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,10 @@ def _send_connection_data(self):
existing_player.team = player.team.id
existing_player.color = make_color(*player.color)
saved_loaders.append(existing_player.generate())
if player.world_object.dead:
kill_action.killer_id = 31
# send kill packets for dead players
if player.player_id != self.player_id and player.world_object \
and player.world_object.dead:
kill_action.killer_id = player.player_id
kill_action.player_id = player.player_id
kill_action.kill_type = FALL_KILL
saved_loaders.append(kill_action.generate())
Expand Down

0 comments on commit b56332e

Please sign in to comment.