Skip to content

Commit

Permalink
支持解析新版游戏蓝图
Browse files Browse the repository at this point in the history
  • Loading branch information
huww98 committed Aug 24, 2024
1 parent 2a21748 commit 5b1a258
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/blueprint/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface BlueprintBuilding {
areaIndex: number,
localOffset: [ XYZ, XYZ ],
yaw: [ number, number ],
tilt: number,
itemId: number,
modelIndex: number,
outputObjIdx: number,
Expand Down Expand Up @@ -805,11 +806,14 @@ function importBuilding(r: BufferReader): BlueprintBuilding {
z: r.getFloat32(),
}
}
const index = r.getInt32();
const v2 = index <= -100;
const b: BlueprintBuilding = {
index: r.getInt32(),
index: v2 ? r.getInt32() : index,
areaIndex: r.getInt8(),
localOffset: [readXYZ(), readXYZ()],
yaw: [r.getFloat32(), r.getFloat32()],
tilt: v2 ? r.getFloat32() : 0.0,
itemId: r.getInt16(),
modelIndex: r.getInt16(),
outputObjIdx: r.getInt32(),
Expand Down

0 comments on commit 5b1a258

Please sign in to comment.