金币商店装备预览

This commit is contained in:
meixiongfeng 2023-07-21 20:41:35 +08:00
parent 3dd386a6fe
commit 58910d3c6e

View File

@ -34,6 +34,7 @@ func randomGoods(goods []*cfg.GameShopitemData) (result *cfg.GameShopitemData) {
func transGoods(goods []*cfg.GameShopitemData, sdata *pb.UserShopData) (result []*pb.ShopItem) {
result = make([]*pb.ShopItem, len(goods))
for i, v := range goods {
id := v.Key*100 + int32(i)
result[i] = &pb.ShopItem{
Gid: sdata.Items[i].Id,
GoodsId: v.Key,
@ -56,7 +57,7 @@ func transGoods(goods []*cfg.GameShopitemData, sdata *pb.UserShopData) (result [
N: int32(math.Ceil(float64(v1.N) * float64(v.Sale) / float64(1000))),
}
}
result[i].Preview = sdata.Preview[v.Key]
result[i].Preview = sdata.Preview[id]
}
return
}