diff --git a/modules/smithy/model_smithy.go b/modules/smithy/model_smithy.go index ba7a4cd20..cc2193556 100644 --- a/modules/smithy/model_smithy.go +++ b/modules/smithy/model_smithy.go @@ -98,8 +98,8 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) { // 计算出需要的时间 _smithycfg := this.module.configure.GetSmithyConfigData(desktype, skillLv) // 美食家配置表 - iCount := int(order.Count) - for i := 0; i < iCount; i++ { + + for i := 0; i < int(order.Count); i++ { curTime += szTime[order.DeskType] order.Count-- if order.Count == 0 { @@ -148,6 +148,14 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) { break } } + // 清除数量为0 的订单 + pos := 0 + for _, order := range smithy.Orders { + if order.Count == 0 { + pos++ + } + } + smithy.Orders = append(smithy.Orders[:0], smithy.Orders[pos:]...) if nextDay { smithy.OrderCostTime += nextDayTime for _, order := range smithy.Orders {