This commit is contained in:
yangduo 2024-12-04 22:17:45 +08:00
parent d9ee206571
commit 82162d6d3a

View File

@ -2,13 +2,14 @@ package activity
import ( import (
"f5" "f5"
"main/constant"
"main/common" "main/common"
"main/vo" "main/constant"
"main/model" "main/model"
"math/rand"
"main/mt" "main/mt"
"main/service" "main/service"
"main/vo"
"math/rand"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -40,7 +41,7 @@ func (this *ActivityApi) RollDice(c *gin.Context) {
f5.RspErr(c, 500, "server internal error2") f5.RspErr(c, 500, "server internal error2")
return return
} }
if user.Dice <= 0 { if reqJson.ForwardPoint == 0 && user.Dice <= 0 {
f5.RspErr(c, 1, "dice not enough") f5.RspErr(c, 1, "dice not enough")
return return
} }
@ -63,11 +64,11 @@ func (this *ActivityApi) RollDice(c *gin.Context) {
f5.RspErr(c, 500, "server internal error5") f5.RspErr(c, 500, "server internal error5")
return return
} }
} } else if err := user.DecDice(1); err != nil {
if err := user.DecDice(1); err != nil {
f5.RspErr(c, 500, "server internal error5") f5.RspErr(c, 500, "server internal error5")
return return
} }
if err := user.AddScore(score); err != nil { if err := user.AddScore(score); err != nil {
f5.RspErr(c, 500, "server internal error6") f5.RspErr(c, 500, "server internal error6")
return return