Merge pull request #1 from Ellie42/fix-full-party-bug

Add a quick fix to allow partying with 4 players
This commit is contained in:
Sophie Tagliabue
2020-03-12 06:58:15 +00:00
committed by GitHub

View File

@@ -646,7 +646,12 @@ func handleMsgSysReserveStage(s *Session, p mhfpacket.MHFPacket) {
stage.Lock()
defer stage.Unlock()
if uint16(len(stage.reservedClientSlots)) < stage.maxPlayers {
// Quick fix to allow readying up while party is full, more investigation needed
// Reserve stage is also sent when a player is ready, probably need to parse the
// request a little more thoroughly.
if _, exists := stage.reservedClientSlots[s.charID]; exists {
s.QueueAck(pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})
} else if uint16(len(stage.reservedClientSlots)) < stage.maxPlayers {
// Add the charID to the stage's reservation map
stage.reservedClientSlots[s.charID] = nil