修改体力转经验

This commit is contained in:
wh_zcy 2023-06-27 14:30:34 +08:00
parent 7d9ff609d3
commit 1b87931794

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)
}