Skip to content

Commit ce3e406

Browse files
authored
Merge pull request #4 from csvwolf/alpha
fix: command error when attack with no extra command
2 parents 14d93f2 + 820329a commit ce3e406

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

commands.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ const translate = function(i) {
145145
module.exports = function (text) {
146146
let resultText = ''
147147
let result = []
148-
const turns = text.split('---\n').filter((i) => !!i)
148+
const turns = text.split('---')
149149
for (let i = 0; i < turns.length; i++) {
150150
resultText += '第' + (i + 1) + '面\n'
151151
result.push([])
152152

153153
// 解析命令
154-
turns[i].split('\n').filter((c) => !!c).forEach(function(command) {
154+
turns[i].split('\n').map(i => i.trim()).filter((c) => !!c).forEach(function(command) {
155155
const c = /^(\w):(\d),(\d),(\d)$/.exec(command)
156156
if (!c) {
157157
toast('错误的指令')

project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@
3636
},
3737
"scripts": {},
3838
"versionCode": 1,
39-
"versionName": "0.0.9"
39+
"versionName": "0.0.10"
4040
}

0 commit comments

Comments
 (0)