From 4273a19aacb6b8b85501b0147f30e2dee3188595 Mon Sep 17 00:00:00 2001 From: Pantocyclus <98746573+Pantocyclus@users.noreply.github.com> Date: Wed, 20 Nov 2024 23:14:33 +0800 Subject: [PATCH 1/2] Fix regex matching --- src/resources/2017/MummingTrunk.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resources/2017/MummingTrunk.ts b/src/resources/2017/MummingTrunk.ts index 9c685191b..0c2c26666 100644 --- a/src/resources/2017/MummingTrunk.ts +++ b/src/resources/2017/MummingTrunk.ts @@ -4,7 +4,7 @@ import { get } from "../../property.js"; import { notNull } from "../../utils.js"; import { isNumericModifier } from "../../modifier.js"; -const MUMMERY_MODS_PATTERN = /\[(\d*)\*fam\([^)]*\)/; +const MUMMERY_MODS_PATTERN = /\[(\d*)\*fam\((.*)\)/; /** * Parses the _mummeryMods preference into a Map for easier use. * @@ -23,8 +23,8 @@ export function currentCostumes(): Map< if (!matcher) return null; return [ - Familiar.get(matcher[1]), - [modifier, Number(matcher[2])], + Familiar.get(matcher[2]), + [modifier, Number(matcher[1])], ] as const; }) .filter(notNull), From 86e72ada9bcb6dbe5d87a8a6f5dcc69d81f05503 Mon Sep 17 00:00:00 2001 From: Pantocyclus <98746573+Pantocyclus@users.noreply.github.com> Date: Wed, 20 Nov 2024 23:44:00 +0800 Subject: [PATCH 2/2] Follow previous pattern instead of using wildcard --- src/resources/2017/MummingTrunk.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/2017/MummingTrunk.ts b/src/resources/2017/MummingTrunk.ts index 0c2c26666..b92981924 100644 --- a/src/resources/2017/MummingTrunk.ts +++ b/src/resources/2017/MummingTrunk.ts @@ -4,7 +4,7 @@ import { get } from "../../property.js"; import { notNull } from "../../utils.js"; import { isNumericModifier } from "../../modifier.js"; -const MUMMERY_MODS_PATTERN = /\[(\d*)\*fam\((.*)\)/; +const MUMMERY_MODS_PATTERN = /\[(\d*)\*fam\(([^)]*)\)/; /** * Parses the _mummeryMods preference into a Map for easier use. *