fix nil character data error

This commit is contained in:
wish
2022-09-05 14:29:25 +10:00
parent 670f8f7882
commit bb12a89074

View File

@@ -1005,17 +1005,7 @@ func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) {
}
applicants, err := GetGuildMembers(s, guild.ID, true)
if err != nil {
resp := byteframe.NewByteFrame()
resp.WriteUint32(0) // Count
resp.WriteUint8(0) // Unk, read if count == 0.
doAckBufSucceed(s, pkt.AckHandle, resp.Data())
}
if err != nil || characterGuildData.IsApplicant {
bf.WriteUint16(0)
} else {
bf.WriteUint16(uint16(len(applicants)))
for _, applicant := range applicants {
bf.WriteUint32(applicant.CharID)
@@ -1025,9 +1015,11 @@ func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) {
bf.WriteUint16(applicant.GR)
ps.Uint8(bf, applicant.Name, true)
}
} else {
bf.WriteUint16(0)
}
bf.WriteUint16(0x0000)
bf.WriteUint16(0x0000) // lenAllianceApplications
/*
alliance application format