Skip to content

Commit b6757b9

Browse files
authored
small fix
1 parent 8ebdb9a commit b6757b9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/chapters/chapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ export type AirSupremacy = {
4747
superiority: number;
4848
supremacy: number;
4949
} | { actual: number; denial: number; parity: number; superiority: number; supremacy: number; };
50-
export type MapDrop = 'string' | { min?: number, max?: number, amm?: string, item: string, guaranteed: boolean };
50+
export type MapDrop = string | { min?: number, max?: number, amm?: string, item: string, guaranteed: boolean };

src/chapters/parser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ function parseMapDrops(div: Element): MapDrop[] {
274274
if (type === "summary") {
275275
if (n.nodeType === 3) rewards.push(n.textContent.replace(",", "").trim());
276276
} else {
277-
buf.push(n?.firstChild?.alt ?? n?.firstChild?.title ?? n?.alt ?? n?.title)
278-
let m = buf.match(MAP_DROP_REGEX)
279-
if (m) {
277+
let e = n as HTMLElement
278+
buf.push(e?.firstChild?.alt ?? e?.firstChild?.title ?? e?.alt ?? e?.title)
279+
while (m = buf.match(MAP_DROP_REGEX)) {
280280
buf = buf.slice(m[0].length)
281281
rewards.push({
282282
min: m.groups?.min ? parseInt(m.groups?.min) : undefined,

0 commit comments

Comments
 (0)