建造打折的宠物币向上取整
This commit is contained in:
parent
0d5979fbcd
commit
643a29e141
@ -98,7 +98,7 @@ func (d *Decorate) GetDecorateCostItem(areaId, decorateId int, decorateOffIsExis
|
||||
id := decorateCfg.GetIdBySenceAndLv(areaId, decorateId)
|
||||
if decorateOffIsExist {
|
||||
offRate := limitedTimeEventCfg.GetDecorateOffDiscount(areaId, decorateId)
|
||||
itemNum = int(math.Round(float64(itemNum) * float64(offRate) / 100))
|
||||
itemNum = int(math.Ceil(float64(itemNum) * float64(offRate) / 100))
|
||||
}
|
||||
items := []*item.Item{item.NewItem(item.ITEM_STAR_ID, itemNum)}
|
||||
partCostInfo := d.PartCost[id]
|
||||
@ -157,7 +157,7 @@ func (d *Decorate) DecorateAll(star int, decorateOffIsExist bool) ([]*item.Item,
|
||||
needStar := decorateCfg.GetStarCost(d.AreaId, v)
|
||||
if decorateOffIsExist {
|
||||
offRate := limitedTimeEventCfg.GetDecorateOffDiscount(d.AreaId, v)
|
||||
needStar = int(math.Round(float64(needStar) * float64(offRate) / 100))
|
||||
needStar = int(math.Ceil(float64(needStar) * float64(offRate) / 100))
|
||||
}
|
||||
if star < needStar {
|
||||
break
|
||||
|
||||
Loading…
Reference in New Issue
Block a user