fix(logic/service/player): 修复玩家信息保存时的指针解引用问题

修复了 Player 结构体在调用 Service.Info.Save 方法时传入的是指针而非实际值的问题,
同时修改 InfoService.Save 方法以接受值类型参数而不是指针,并更新内部数据赋值逻辑。
This commit is contained in:
2025-11-17 11:00:12 +08:00
parent 8ee5508974
commit f1c990c182
2 changed files with 4 additions and 4 deletions

View File

@@ -46,7 +46,7 @@ func (p *Player) Save() {
p.Info.OnlineTime = p.Info.OnlineTime + (newtime-uint32(p.Logintime))/60 //每次退出时候保存已经在线的分钟数
p.Service.Info.Save(p.Info)
p.Service.Info.Save(*p.Info)
space.GetSpace(p.Info.MapID).LeaveMap(p)
p.StopChan.Stop() //停止刷怪