Skip to content

Commit 99f3829

Browse files
committed
fix error while serializing string with null value, fix gitadora skill>1000 issue
1 parent 8504ec9 commit 99f3829

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ input.xml
3434
output.json
3535
dump.xml
3636
pdata.json
37+
dump.bin

src/controllers/gitadora/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export class User {
185185
for (const seq in m.seqs) {
186186
const rec = m.seqs[seq];
187187
if (rec.skill > bestScore) {
188-
bestScore = rec.skill;
188+
bestScore = rec.skill % 10000;
189189
bestSeq = +seq;
190190
}
191191

src/utils/kbinxml.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ function serializeValue(value: any, type: string): string {
168168
}
169169

170170
if (['str', 'string'].includes(type)) {
171+
if (!value.replace) {
172+
return 'null';
173+
}
174+
171175
return value.replace(/[<>&'"]/g, (ch: string) => {
172176
switch (ch) {
173177
case '<': return '&lt;';

0 commit comments

Comments
 (0)