From 91abb8201a325525c72cec2349a8dd7e943a5ca6 Mon Sep 17 00:00:00 2001 From: Ali <47182802+UnknownOre@users.noreply.github.com> Date: Mon, 10 Jun 2024 20:01:05 +0300 Subject: [PATCH] fix Abilities not working after changing gamemode --- server/session/player.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/session/player.go b/server/session/player.go index 0552af589..b9c5ae9b8 100644 --- a/server/session/player.go +++ b/server/session/player.go @@ -393,7 +393,9 @@ func (s *Session) SendGameMode(mode world.GameMode) { return } s.writePacket(&packet.SetPlayerGameType{GameType: gameTypeFromMode(mode)}) - s.sendAbilities() + time.AfterFunc(time.Millisecond*50, func() { + s.sendAbilities() // TODO: HACK: For some reason, if the ability settings are sent at the same time as the game mode change, it won't work. + }) } // sendAbilities sends the abilities of the Controllable entity of the session to the client.