Skip to content

Commit a0c3325

Browse files
committed
Change default facing direction to south to match liblcf
Fixes an issue where a north-facing client would show up as south- facing to other players after they reconnected. Client PR: ynoproject/ynoengine#67
1 parent 3095108 commit a0c3325

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

server/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const (
3333
maxMessageSize = 4096
3434

3535
maxPictures = 1000
36+
37+
defaultFacing = 2 // down
3638
)
3739

3840
type Picture struct {
@@ -303,7 +305,7 @@ func (c *RoomClient) disconnect() {
303305
func (c *RoomClient) reset() {
304306
c.x = -1
305307
c.y = -1
306-
c.facing = 0
308+
c.facing = defaultFacing
307309
c.speed = 0
308310

309311
c.flash = [5]int{}

server/room.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ func (c *RoomClient) getPlayerData(client *RoomClient) {
341341
if client.x != -1 {
342342
c.outbox <- buildMsg("m", client.session.id, client.x, client.y)
343343
}
344-
if client.facing != 0 {
344+
if client.facing != defaultFacing {
345345
c.outbox <- buildMsg("f", client.session.id, client.facing)
346346
}
347347
if client.speed != 0 {

0 commit comments

Comments
 (0)