Skip to content

Commit

Permalink
Rename object scripts property 🏡.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarty committed May 27, 2024
1 parent 2a0b5f1 commit 3ac9451
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/parser/parseRooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const parseRooms = (arrayBuffer, i = 0, offset = 0, characters = {}) => {
const objectScriptOffsParser = new Parser(
arrayBuffer.slice(objectOffs + 0x0f, objectOffs + objectSize),
);
const objScripts = [];
const scripts = [];
while (objectScriptOffsParser.pointer < objectSize) {
const verbId = objectScriptOffsParser.getUint8();
if (verbId === 0) {
Expand All @@ -285,7 +285,7 @@ const parseRooms = (arrayBuffer, i = 0, offset = 0, characters = {}) => {
);

const script = parseScriptCode(scriptOffsParser, 0, 0);
objScripts.push([verbs[verbId] ?? `(${verbId})`, script]);
scripts.push([verbs[verbId] ?? `(${verbId})`, script]);
}

// Parse object images.
Expand Down Expand Up @@ -335,7 +335,7 @@ const parseRooms = (arrayBuffer, i = 0, offset = 0, characters = {}) => {
// Calculate the number of object script given the value of object name offset.
const calculatedObjScriptNum = (objNameOffs - 16) / 2;
assert(
calculatedObjScriptNum === objScripts.length,
calculatedObjScriptNum === scripts.length,
'Unknown data before object name offset.',
);

Expand All @@ -357,7 +357,7 @@ const parseRooms = (arrayBuffer, i = 0, offset = 0, characters = {}) => {
actorDir: objActorDir,
nameOffs: objNameOffs,
name: objName,
objScripts,
scripts,
});
}

Expand Down

0 comments on commit 3ac9451

Please sign in to comment.