Skip to content

Commit

Permalink
session/handler_server_bound_loading_screen.go: Allow empty/0 screen IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistedAsylumMC committed Aug 15, 2024
1 parent 408171b commit 1fe983b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions server/session/handler_server_bound_loading_screen.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ type ServerBoundLoadingScreenHandler struct {
// Handle ...
func (h *ServerBoundLoadingScreenHandler) Handle(p packet.Packet, s *Session) error {
pk := p.(*packet.ServerBoundLoadingScreen)
if h.expectedID.Load() == 0 {
return fmt.Errorf("unexpected loading screen packet")
}
v, ok := pk.LoadingScreenID.Value()
if !ok {
return fmt.Errorf("expected loading screen ID %d, got nothing", h.expectedID.Load())
if !ok || h.expectedID.Load() == 0 {
return nil
} else if v != h.expectedID.Load() {
return fmt.Errorf("expected loading screen ID %d, got %d", h.expectedID.Load(), v)
} else if pk.Type == packet.LoadingScreenTypeEnd {
Expand Down

0 comments on commit 1fe983b

Please sign in to comment.