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 ed7bb5a

Browse files
committed
fix id
1 parent 36bcd0e commit ed7bb5a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎models/room/room.go‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"github.com/blobs-io/blobsgame/models/gamemap"
55
"github.com/blobs-io/blobsgame/models/item"
66
"github.com/blobs-io/blobsgame/models/player"
7+
"strconv"
78
)
89

910
const (
@@ -29,11 +30,12 @@ func New(mode uint8) *Room {
2930
r := Room {
3031
Mode: mode,
3132
}
33+
r.ID = r.ModeToString() + strconv.Itoa(len(Rooms))
3234

3335
r.Players = make([]player.Player, 0)
3436
r.Items = make([]item.Item, 0)
3537

36-
Rooms[r.ModeToString()] = r
38+
Rooms[r.ID] = r
3739

3840
return &r
3941
}

0 commit comments

Comments
(0)

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