mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 05:30:07 +08:00
fix: two bugs in mcifsh (#1029)
1. 修复商品数量大于250时,商品价格浮动区间数值异常 2. 修复出售限制未生效的问题。(时间未更新)
This commit is contained in:
parent
78d156395b
commit
b9bea7dff7
@ -593,8 +593,8 @@ func (sql *fishdb) refreshStroeInfo() (ok bool, err error) {
|
|||||||
thingInfo := store{}
|
thingInfo := store{}
|
||||||
_ = sql.db.Find("store", &thingInfo, "where Name = '"+name+"'")
|
_ = sql.db.Find("store", &thingInfo, "where Name = '"+name+"'")
|
||||||
if thingInfo.Number > 150 {
|
if thingInfo.Number > 150 {
|
||||||
// 通货膨胀
|
// 商品贬值,价格区间 -50%到0%
|
||||||
thing.Discount = (1000 - 5*(thingInfo.Number-150)) / 10
|
thing.Discount = 50 + rand.Intn(50)
|
||||||
}
|
}
|
||||||
err = sql.db.Insert("stroeDiscount", &thing)
|
err = sql.db.Insert("stroeDiscount", &thing)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -826,6 +826,10 @@ func (sql *fishdb) selectCanSalesFishFor(uid int64, sales int) int {
|
|||||||
if time.Now().Day() != time.Unix(userInfo.Duration, 0).Day() {
|
if time.Now().Day() != time.Unix(userInfo.Duration, 0).Day() {
|
||||||
userInfo.Duration = time.Now().Unix()
|
userInfo.Duration = time.Now().Unix()
|
||||||
userInfo.SalesFish = 0
|
userInfo.SalesFish = 0
|
||||||
|
err := sql.db.Insert("buff", &userInfo)
|
||||||
|
if err != nil {
|
||||||
|
return residue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
maxSales := 100 - userInfo.SalesFish
|
maxSales := 100 - userInfo.SalesFish
|
||||||
if maxSales < 0 {
|
if maxSales < 0 {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user