feat(item): 出售物品后减少背包中对应物品数量

在处理物品出售逻辑时,增加调用 SubItem 方法以正确扣减玩家背包中的物品数量。

feat(map): 玩家离开地图时重置 Canmon 标志位

通过 atomic.StoreUint32 将玩家的 Canmon 状态设置为 0,确保线程安全。

fix(pet): 调整宠物经验增加逻辑并修复技能学习问题

重构 AddPetExp 方法逻辑,优化升级流程、技能学习机制,并修正经验显示
This commit is contained in:
2025-12-13 21:47:07 +08:00
parent 2ab7f59667
commit fe89620efb
11 changed files with 96 additions and 45 deletions

View File

@@ -229,7 +229,7 @@ func (h Controller) SetPetExp(data *pet.PetSetExpInboundInfo, c *player.Player)
_, onpet, ok := c.FindPet(data.CatchTime)
if ok && onpet.Level < 100 {
defer c.AddPetExp(onpet, data.Exp)
c.AddPetExp(onpet, data.Exp)
return &pet.PetSetExpOutboundInfo{
Exp: c.Info.ExpPool,
}, 0