场景折扣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) id := decorateCfg.GetIdBySenceAndLv(areaId, decorateId)
if decorateOffIsExist { if decorateOffIsExist {
offRate := limitedTimeEventCfg.GetDecorateOffDiscount(areaId, decorateId) 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)} items := []*item.Item{item.NewItem(item.ITEM_STAR_ID, itemNum)}
partCostInfo := d.PartCost[id] partCostInfo := d.PartCost[id]
@ -157,7 +157,7 @@ func (d *Decorate) DecorateAll(star int, decorateOffIsExist bool) ([]*item.Item,
needStar := decorateCfg.GetStarCost(d.AreaId, v) needStar := decorateCfg.GetStarCost(d.AreaId, v)
if decorateOffIsExist { if decorateOffIsExist {
offRate := limitedTimeEventCfg.GetDecorateOffDiscount(d.AreaId, v) 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 { if star < needStar {
break break