boss属性丢失,全部被限制属性不能超越,应该给ai和玩家施加不同的getinfo方法
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
道具扣除判断,因为判断扣完大于0,所以导致只剩一个的时候,道具成功使用但是不会扣除数量
This commit is contained in:
@@ -1,8 +1,16 @@
|
|||||||
package player
|
package player
|
||||||
|
|
||||||
|
import "blazing/modules/player/model"
|
||||||
|
|
||||||
type AI_player struct {
|
type AI_player struct {
|
||||||
baseplayer
|
baseplayer
|
||||||
|
|
||||||
CanCapture int
|
CanCapture int
|
||||||
BossScript string
|
BossScript string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *AI_player) GetPetInfo(_ uint32) []model.PetInfo {
|
||||||
|
ret := make([]model.PetInfo, 0, len(p.Info.PetList))
|
||||||
|
ret = append(ret, p.Info.PetList...)
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ func (s *ItemService) UPDATE(id uint32, count int) error {
|
|||||||
if ok {
|
if ok {
|
||||||
updateModel := s.dbm(s.Model).Where("item_id", id)
|
updateModel := s.dbm(s.Model).Where("item_id", id)
|
||||||
if count < 0 {
|
if count < 0 {
|
||||||
updateModel = updateModel.Where("item_cnt + ? > 0", count)
|
updateModel = updateModel.Where("item_cnt + ? >= 0", count)
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := updateModel.Increment("item_cnt", count)
|
result, err := updateModel.Increment("item_cnt", count)
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ func updateItemCountTx(tx gdb.TX, userID uint32, id uint32, count int) error {
|
|||||||
Where("is_vip", cool.Config.ServerInfo.IsVip).
|
Where("is_vip", cool.Config.ServerInfo.IsVip).
|
||||||
Where("item_id", id)
|
Where("item_id", id)
|
||||||
if count < 0 {
|
if count < 0 {
|
||||||
updateModel = updateModel.Where("item_cnt + ? > 0", count)
|
updateModel = updateModel.Where("item_cnt + ? >= 0", count)
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := updateModel.Increment("item_cnt", count)
|
result, err := updateModel.Increment("item_cnt", count)
|
||||||
|
|||||||
Reference in New Issue
Block a user