mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-29 12:02:56 +02:00
fix(channelserver): post-RC1 stabilization sprint
Fix rasta_id=0 overwriting NULL in SaveMercenary, which prevented game state saving for characters without a mercenary (#163). Also includes: - CHANGELOG updated with all 10 post-RC1 commits - Setup wizard fmt.Printf replaced with zap structured logging - technical-debt.md updated with 6 newly completed items - Scenario binary format documented (docs/scenario-format.md) - Tests: alliance nil-guard (#171), handler dispatch table, migrations (sorted/SQL/baseline), setup wizard (10 tests), protbot protocol sign/entrance/channel (23 tests)
This commit is contained in:
@@ -194,7 +194,12 @@ func handleMsgMhfSaveMercenary(s *Session, p mhfpacket.MHFPacket) {
|
||||
dumpSaveData(s, pkt.MercData, "mercenary")
|
||||
if len(pkt.MercData) >= 4 {
|
||||
temp := byteframe.NewByteFrameFromBytes(pkt.MercData)
|
||||
if err := s.server.charRepo.SaveMercenary(s.charID, pkt.MercData, temp.ReadUint32()); err != nil {
|
||||
rastaID := temp.ReadUint32()
|
||||
if rastaID == 0 {
|
||||
s.logger.Warn("Mercenary save with rasta_id=0, preserving existing value",
|
||||
zap.Uint32("charID", s.charID))
|
||||
}
|
||||
if err := s.server.charRepo.SaveMercenary(s.charID, pkt.MercData, rastaID); err != nil {
|
||||
s.logger.Error("Failed to save mercenary data", zap.Error(err))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user