This commit is contained in:
yangduo 2024-12-10 11:20:04 +08:00
parent fd92cf0de1
commit 94e4b77ec3
2 changed files with 11 additions and 6 deletions

View File

@ -128,7 +128,8 @@ func (this *ActivityApi) RollDice(c *gin.Context) {
awardgridids := mt.Table.MapGrid.GetAwardGridIdList()
user.AddAwardGrid(user.CurrGrid)
if len(awardgridids) >= len(userAwardgrids) {
userAwardgrids = user.GetAwardGrids()
if len(awardgridids) <= len(userAwardgrids) {
fullgrid = true
}
}

View File

@ -30,10 +30,12 @@ func (this *MapGrid) Init1() {
tmpStrs := strings.Split(this.MapGrid.GetReward(), "|")
for _, tmpStr := range tmpStrs {
tmpStrs2 := strings.Split(tmpStr, ":")
p := new(MapGridRewardItem)
p.ItemId = q5.ToInt32(tmpStrs2[0])
p.ItemNum = q5.ToInt32(tmpStrs2[1])
q5.AppendSlice(&this.rewardItems, p)
if len(tmpStrs2) > 1 {
p := new(MapGridRewardItem)
p.ItemId = q5.ToInt32(tmpStrs2[0])
p.ItemNum = q5.ToInt32(tmpStrs2[1])
q5.AppendSlice(&this.rewardItems, p)
}
}
}
@ -60,7 +62,9 @@ func (this *MapGridTable) GetMaxGridId() int32 {
func (this *MapGridTable) GetAwardGridIdList() []int32 {
idlist := []int32{}
for _, item := range this.awardGrids {
idlist = append(idlist, item.GetId())
if item.GetId() > 0 {
idlist = append(idlist, item.GetId())
}
}
return idlist