float64 类型转换
This commit is contained in:
parent
41b33e1e86
commit
e78d2590e5
@ -6,6 +6,7 @@ import (
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"go_dreamfactory/utils"
|
||||
"math"
|
||||
)
|
||||
|
||||
// 参数校验
|
||||
@ -97,7 +98,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
|
||||
for _, v := range _c.LikesFood { // 喜欢的食物
|
||||
if v == req.Items {
|
||||
likeStates = 1
|
||||
addExp *= this.module.ModuleTools.GetGlobalConf().FavorabilityLikes * req.Counts / 1000
|
||||
addExp = int32(math.Floor(float64(addExp*this.module.ModuleTools.GetGlobalConf().FavorabilityLikes*req.Counts) / 1000))
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -105,7 +106,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
|
||||
for _, v := range _c.DislikingFood { //不喜欢
|
||||
if v == req.Items {
|
||||
likeStates = 2
|
||||
addExp *= this.module.ModuleTools.GetGlobalConf().FavorabilityDislikes * req.Counts / 1000
|
||||
addExp = int32(math.Floor(float64(addExp*this.module.ModuleTools.GetGlobalConf().FavorabilityDislikes*req.Counts) / 1000))
|
||||
break
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user