laneya2

cave exploration game
git clone https://git.ce9e.org/laneya2.git

commit
0319bf091cd38df43ff35ad0930d35117ba84efc
parent
becc1d975349c9667c907e0c98a1ddeb135b9903
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2024-09-28 16:32
fix: send SetHealth only to player

Diffstat

M player.go 4 ++--

1 files changed, 2 insertions, 2 deletions


diff --git a/player.go b/player.go

@@ -42,11 +42,11 @@ func (player *Player) Move(dir string) {
   42    42 func (player *Player) TakeDamage(amount uint) {
   43    43 	// TODO: death if amount >= player.Health
   44    44 	player.Health -= amount
   45    -1 	player.Game.broadcast([]Message{
   -1    45 	player.Send <- []Message{
   46    46 		Message{
   47    47 			"action":      "setHealth",
   48    48 			"health":      player.Health,
   49    49 			"healthTotal": player.HealthTotal,
   50    50 		},
   51    -1 	})
   -1    51 	}
   52    52 }