Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4e1e78b

Browse files
committed
gateway: fix health
1 parent 5b5c894 commit 4e1e78b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎http/gateway/item_collect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func ItemCollectEventCallback(c *WebSocketConnection, d *AnyMessage) {
4949

5050
switch targetItem.Type {
5151
case item.HealthItem:
52-
p.Health += uint8(rand.Intn(5) + 10)
52+
p.Health += int8(rand.Intn(5) + 10)
5353
case item.CoinItem:
5454
// TODO: generate random coins
5555
}

‎http/gateway/nom_key.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NomKeyEventCallback(c *WebSocketConnection, d *AnyMessage) {
4242
}
4343

4444
p.LastNom = now
45-
target.Health -= uint8(rand.Intn(10) + 30)
45+
target.Health -= int8(rand.Intn(10) + 30)
4646
if target.Health > 0 {
4747
break
4848
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /