Skip to content

Commit

Permalink
Merge pull request #70 from dark0dave/fix/embededEffects
Browse files Browse the repository at this point in the history
fix(embed): Fix for embedded effect v1
  • Loading branch information
dark0dave authored Nov 13, 2024
2 parents 8d66e8d + 78c86dd commit e5ae405
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
3 changes: 2 additions & 1 deletion fixtures/sw1h01.itm.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"melee_animation": [50, 0, 50, 0, 0, 0],
"is_arrow": 0,
"is_bolt": 0,
"is_bullet": 0
"is_bullet": 0,
"effects": []
}
],
"equipping_feature_blocks": [
Expand Down
Binary file added fixtures/zbpdnote.itm
Binary file not shown.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "infinity-viewer",
"displayName": "infinity-viewer",
"description": "Infinity Viewer lets you view infinity engine binary files as json",
"version": "0.7.2",
"version": "0.8.0",
"keywords": [
"Infinity Engine",
"Baldur's Gate",
Expand All @@ -28,9 +28,6 @@
"categories": [
"Programming Languages"
],
"activationEvents": [
"onCustomEditor:ie.preview"
],
"main": "./out/extension.js",
"contributes": {
"capabilities": {
Expand Down
12 changes: 10 additions & 2 deletions src/models/itm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { feature_block_parser, header_parser } from "./common";
import {
effect_v1_parser,
feature_block_parser,
header_parser,
} from "./common";
import { Parser } from "binary-parser";

const item_header_parser = header_parser()
Expand Down Expand Up @@ -73,7 +77,11 @@ const extended_item_header_parser = new Parser()
})
.uint16le("is_arrow")
.uint16le("is_bolt")
.uint16le("is_bullet");
.uint16le("is_bullet")
.array("effects", {
type: effect_v1_parser,
length: "feature_blocks_count",
});

const parser = item_header_parser
.array("extended_headers", {
Expand Down

0 comments on commit e5ae405

Please # to comment.