feat(game): 实现扭蛋系统批量物品添加功能并优化地图逻辑 - 新增ItemAddBatch方法用于批量添加物品,支持普通道具和特殊道具的分别处理 - 优化扭蛋游戏玩法中的物品添加逻辑,使用新的批量接口提升性能 - 在扭蛋机器人命令中实现完整的物品检查和批量添加流程 refactor(map): 重构地图控制器代码结构并添加注释 - 为EnterMap、LeaveMap、GetMapPlayerList等方法添加中文注释 - 统一地图相关的命名规范,如enter
This commit is contained in:
@@ -47,9 +47,8 @@ func (h Controller) EggGamePlay(data1 *C2S_EGG_GAME_PLAY, c *player.Player) (res
|
||||
}
|
||||
|
||||
items := service.NewItemService().GetEgg(int(data1.EggNum))
|
||||
for _, item := range items {
|
||||
|
||||
c.ItemAdd(item.ItemId, item.ItemCnt)
|
||||
addedItems := c.ItemAddBatch(items)
|
||||
for _, item := range addedItems {
|
||||
result.ListInfo = append(result.ListInfo, data.ItemInfo{ItemId: item.ItemId, ItemCnt: item.ItemCnt})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user