This commit is contained in:
@@ -26,12 +26,11 @@ func (h Controller) EggGamePlay(data1 *C2S_EGG_GAME_PLAY, c *player.Player) (res
|
||||
if data1.EggNum > 10 || data1.EggNum <= 0 {
|
||||
return nil, errorcode.ErrorCode(errorcode.ErrorCodes.ErrSystemError)
|
||||
}
|
||||
if r < 0 {
|
||||
if r <= 0 || data1.EggNum >= r {
|
||||
return nil, errorcode.ErrorCode(errorcode.ErrorCodes.ErrGachaTicketsInsufficient)
|
||||
}
|
||||
if data1.EggNum > r {
|
||||
if err := c.Service.Item.UPDATE(400501, int(-data1.EggNum)); err != nil {
|
||||
return nil, errorcode.ErrorCode(errorcode.ErrorCodes.ErrGachaTicketsInsufficient)
|
||||
|
||||
}
|
||||
result = &S2C_EGG_GAME_PLAY{ListInfo: []data.ItemInfo{}}
|
||||
if grand.Meet(int(data1.EggNum), 100) {
|
||||
@@ -52,8 +51,6 @@ func (h Controller) EggGamePlay(data1 *C2S_EGG_GAME_PLAY, c *player.Player) (res
|
||||
for _, item := range addedItems {
|
||||
result.ListInfo = append(result.ListInfo, data.ItemInfo{ItemId: item.ItemId, ItemCnt: item.ItemCnt})
|
||||
}
|
||||
|
||||
c.Service.Item.UPDATE(400501, int(-data1.EggNum))
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user