This commit is contained in:
@@ -153,7 +153,11 @@ func (h Controller) ChangePlayerCloth(data *item.ChangePlayerClothInboundInfo, p
|
||||
}
|
||||
|
||||
for _, clothID := range data.ClothList {
|
||||
result.ClothList = append(result.ClothList, model.PeopleItemInfo{ID: clothID, Level: 1})
|
||||
|
||||
if player.Service.Item.Exist(clothID) {
|
||||
result.ClothList = append(result.ClothList, model.PeopleItemInfo{ID: clothID, Level: 1})
|
||||
}
|
||||
|
||||
}
|
||||
player.Info.Clothes = result.ClothList
|
||||
|
||||
|
||||
@@ -8,6 +8,14 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
func (s *ItemService) Exist(itemid uint32) bool {
|
||||
|
||||
var ttt *model.Item
|
||||
s.TestModel(s.Model).Where("item_id", itemid).Scan(&ttt)
|
||||
|
||||
return ttt != nil
|
||||
|
||||
}
|
||||
func (s *ItemService) Get(min, max uint32) []model.Item {
|
||||
|
||||
var ttt []model.Item
|
||||
|
||||
Reference in New Issue
Block a user