Skip to content
This repository was archived by the owner on Oct 2, 2022. It is now read-only.

Commit fb54e55

Browse files
committed
Bugfix: Fix unlocked scene behavior.
1 parent 673eeee commit fb54e55

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/controller/scene.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@ func SceneSetUnlock(ctx echo.Context) error {
9393
if err != nil {
9494
return context.Error(ctx, http.StatusInternalServerError, "failed to get user info", err)
9595
}
96-
if user.LastQuestion != scene.FromQuestion && scene.FromQuestion != model.NullID { // 排除入口剧情
97-
return context.Error(ctx, http.StatusForbidden, "you cannot unlock this scene", nil)
98-
}
9996
finished, err := m.UserHasFinishedQuestion(userID, scene.NextQuestion)
10097
if err != nil {
10198
return context.Error(ctx, http.StatusInternalServerError, "failed to get user info", err)
10299
}
103100
if finished {
104101
return context.Success(ctx, nil)
105102
}
103+
if user.LastQuestion != scene.FromQuestion && scene.FromQuestion != model.NullID { // 排除入口剧情
104+
return context.Error(ctx, http.StatusForbidden, "you cannot unlock this scene", nil)
105+
}
106106

107107
err = m.SetUserLastScene(userID, id)
108108
if err != nil {

0 commit comments

Comments
 (0)