城市购买饱和系数
This commit is contained in:
parent
97b2284820
commit
28dc696beb
@ -50,15 +50,15 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
|
||||
items := caravan.Items[k]
|
||||
var price int32
|
||||
price = items.Price
|
||||
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||
for _, v := range cityConf.Exspecial {
|
||||
if v == k {
|
||||
price = cityConf.Exspecialnum * items.Price / 1000
|
||||
// if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||
// for _, v := range cityConf.Exspecial {
|
||||
// if v == k {
|
||||
// price = cityConf.Exspecialnum * items.Price / 1000
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
addScore += price * v // 卖出收益
|
||||
}
|
||||
if this.module.ArrayBag(caravan, upperLimit) { // 背包满了
|
||||
@ -109,6 +109,14 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
|
||||
code = pb.ErrorCode_TrollCityUnSellItem // 城市不卖这个物品
|
||||
return
|
||||
}
|
||||
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||
for _, v := range cityConf.Exspecial {
|
||||
if v == k {
|
||||
price = cityConf.Exspecialnum * caravan.Goods[k].Price / 1000
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
caravan.Items[k].Count += v
|
||||
|
||||
totla += price * v
|
||||
|
Loading…
Reference in New Issue
Block a user