update
This commit is contained in:
parent
a1f28a0ba6
commit
cbb2e96764
@ -50,15 +50,25 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
|
|||||||
items := caravan.Items[k]
|
items := caravan.Items[k]
|
||||||
var price int32
|
var price int32
|
||||||
price = items.Price
|
price = items.Price
|
||||||
|
bFound := false
|
||||||
for _, v := range cityInfo.Special {
|
for _, v := range cityInfo.Special {
|
||||||
if v == k {
|
if v == k {
|
||||||
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||||
price = cityConf.Specialnum * price / 1000
|
price = cityConf.Specialnum * price / 1000
|
||||||
|
bFound = true
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if !bFound {
|
||||||
|
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||||
|
for _, v := range cityConf.Exspecial {
|
||||||
|
if v == k {
|
||||||
|
price = cityConf.Exspecialnum * price / 1000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
addScore += price * v // 卖出收益
|
addScore += price * v // 卖出收益
|
||||||
}
|
}
|
||||||
if this.module.ArrayBag(caravan, upperLimit) { // 背包满了
|
if this.module.ArrayBag(caravan, upperLimit) { // 背包满了
|
||||||
|
Loading…
Reference in New Issue
Block a user