Skip to content

Commit

Permalink
Merge pull request #4 from csvwolf/alpha
Browse files Browse the repository at this point in the history
fix: command error when attack with no extra command
  • Loading branch information
csvwolf authored Aug 15, 2021
2 parents 14d93f2 + 820329a commit ce3e406
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ const translate = function(i) {
module.exports = function (text) {
let resultText = ''
let result = []
const turns = text.split('---\n').filter((i) => !!i)
const turns = text.split('---')
for (let i = 0; i < turns.length; i++) {
resultText += '第' + (i + 1) + '面\n'
result.push([])

// 解析命令
turns[i].split('\n').filter((c) => !!c).forEach(function(command) {
turns[i].split('\n').map(i => i.trim()).filter((c) => !!c).forEach(function(command) {
const c = /^(\w):(\d),(\d),(\d)$/.exec(command)
if (!c) {
toast('错误的指令')
Expand Down
2 changes: 1 addition & 1 deletion project.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
},
"scripts": {},
"versionCode": 1,
"versionName": "0.0.9"
"versionName": "0.0.10"
}

0 comments on commit ce3e406

Please sign in to comment.