场景折扣bug修复

This commit is contained in:
hahwu 2026-04-13 12:06:36 +08:00
parent bf7b202105
commit 541e966a7f

View File

@ -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.Ceil(float64(itemNum) * float64(offRate)))
itemNum = int(math.Round(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.Ceil(float64(needStar) * float64(offRate)))
needStar = int(math.Round(float64(needStar) * float64(offRate) / 100))
}
if star < needStar {
break