This commit is contained in:
meixiongfeng 2023-06-27 14:38:07 +08:00
commit efd31be11f

View File

@ -1144,26 +1144,15 @@ func (this *User) ConsumePsAddExp(session comm.IUserSession, ps int32) (addExp i
return
}
var (
user *pb.DBUser
)
if user = this.GetUser(session.GetUserId()); user == nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_UserNofound,
Title: pb.ErrorCode_UserNofound.ToString(),
}
return
}
ggd := this.ModuleTools.GetGlobalConf()
if ggd == nil {
return
}
//体力消耗,增加玩家经验
addExp = ps * ggd.FightPs
user.Exp += int64(addExp)
attrs := make(map[string]int32, 0)
attrs["exp"] = int32(user.Exp)
attrs["exp"] = addExp
return addExp, this.AddAttributeValues(session, attrs, true)
}