This commit is contained in:
meixiongfeng 2023-11-02 15:52:25 +08:00
parent d544c13b64
commit a920f31d81
2 changed files with 7 additions and 4 deletions

View File

@ -23,6 +23,7 @@ func (this *apiComp) BoxReward(session comm.IUserSession, req *pb.EntertainBoxRe
list *pb.DBXXLData list *pb.DBXXLData
err error err error
atno []*pb.UserAtno atno []*pb.UserAtno
boxid int32
) )
list, err = this.module.model.getEntertainmList(session.GetUserId()) list, err = this.module.model.getEntertainmList(session.GetUserId())
if err != nil { if err != nil {
@ -42,12 +43,13 @@ func (this *apiComp) BoxReward(session comm.IUserSession, req *pb.EntertainBoxRe
} }
// 校验时间 // 校验时间
if configure.Now().Unix() >= list.Box[req.Index].Opentime { if configure.Now().Unix() >= list.Box[req.Index].Opentime {
boxid = list.Box[req.Index].Boxid
list.Box = append(list.Box[:req.Index], list.Box[req.Index+1:]...) list.Box = append(list.Box[:req.Index], list.Box[req.Index+1:]...)
this.module.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{ this.module.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{
"box": list.Box, "box": list.Box,
}) })
// 发奖 // 发奖
if conf, err := this.module.configure.GetGameConsumeBoxConf(list.Box[req.Index].Boxid); err != nil { if conf, err := this.module.configure.GetGameConsumeBoxConf(boxid); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound, Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(), Title: pb.ErrorCode_ConfigNoFound.ToString(),

View File

@ -530,6 +530,7 @@ func (this *MapData) SkillUp(pos int32, color int32, skillid int32, value int32,
} }
} else if skillid == 3 || skillid == 5 { //选中一个方块,消除周围一圈 } else if skillid == 3 || skillid == 5 { //选中一个方块,消除周围一圈
ids = append(ids, int(pos)) // 包含自己
x := int(pos / Width) x := int(pos / Width)
y := int(pos % Height) y := int(pos % Height)
if x-1 >= 0 { // 左 if x-1 >= 0 { // 左