Skip to content

Commit 589e382

Browse files
committed
old to new conversion
1 parent 5284421 commit 589e382

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

language.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,14 @@ namespace microcode {
236236
public static fromBuffer(br: BufferReader) {
237237
const defn = new RuleDefn()
238238
const handleFieldEditor = (which: string) => {
239-
const by = br.readByte()
239+
let by = br.readByte()
240+
// convert from old to new
241+
if (isOldModifierCoin(by))
242+
by = Tid.TID_FILTER_COIN_1 + (by - Tid.TID_MODIFIER_COIN_1)
243+
if (isOldModifierVar(by))
244+
by =
245+
Tid.TID_FILTER_CUP_X_READ +
246+
(by - Tid.TID_MODIFIER_CUP_X_READ)
240247
const tile = getEditor(by)
241248
if (tile instanceof ModifierEditor) {
242249
const field = tile.fieldEditor.fromBuffer(br)

0 commit comments

Comments
 (0)