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]
|
||||
var price int32
|
||||
price = items.Price
|
||||
bFound := false
|
||||
for _, v := range cityInfo.Special {
|
||||
if v == k {
|
||||
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||
price = cityConf.Specialnum * price / 1000
|
||||
bFound = true
|
||||
}
|
||||
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 // 卖出收益
|
||||
}
|
||||
if this.module.ArrayBag(caravan, upperLimit) { // 背包满了
|
||||
|
Loading…
Reference in New Issue
Block a user