Skip to content

Commit

Permalink
Merge pull request #31 from skrmsh/feature/got-hit-hp-param
Browse files Browse the repository at this point in the history
Just a little fix
  • Loading branch information
olell authored Nov 27, 2023
2 parents 1a3e3b6 + 2a4dc6e commit c0322a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion skirmserv/communication/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,14 @@ def _on_got_hit(self, data):
# Get pid and sid fields
pid = data.get("pid", None)
sid = data.get("sid", None)
hp = data.get("hp", None)

# do not act on missing fields
if pid is None or sid is None:
return

# Trigger got_hit method from associated player
self.player.got_hit(pid, sid)
self.player.got_hit(pid, sid, hp)

def _on_send_shot(self, data):
"""Send Shot event triggered by client"""
Expand Down

0 comments on commit c0322a0

Please sign in to comment.