Skip to content

Commit

Permalink
Fix room bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
jchv committed Jul 16, 2023
1 parent 87e0656 commit 91d8a5a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion game/room/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,13 @@ func (r *Room) handlePlayerLeave(ctx context.Context, event RoomPlayerLeave) err

func (r *Room) handlePlayerUpdateData(ctx context.Context, event RoomPlayerUpdateData) error {
if pair := r.players.GetPair(event.ConnID); pair != nil {
*pair.Value.Entry = *event.Entry
newEntry := *event.Entry
newEntry.Angle = pair.Value.Entry.Angle
newEntry.X = pair.Value.Entry.X
newEntry.Y = pair.Value.Entry.Y
newEntry.Z = pair.Value.Entry.Z
newEntry.StatusFlags = pair.Value.Entry.StatusFlags
*pair.Value.Entry = newEntry
pair.Value.PlayerData = event.PlayerData
// TODO: only need to send delta here
return r.broadcastPlayerList(ctx)
Expand Down

0 comments on commit 91d8a5a

Please sign in to comment.