Skip to content

Commit

Permalink
feat(cre): Better cre parser
Browse files Browse the repository at this point in the history
Signed-off-by: dark0dave <dark0dave@mykolab.com>
  • Loading branch information
dark0dave committed Aug 28, 2024
1 parent 9326172 commit ef91554
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ target/
CHANGELOG.md
perf*
flamegraph*
Cargo.toml.test
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "post_infinity"
version = "5.0.0"
version = "5.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
8 changes: 5 additions & 3 deletions models/src/creature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use binrw::{
};
use serde::{Deserialize, Serialize};

use crate::common::char_array::CharArray;
use crate::common::{resref::Resref, strref::Strref};
use crate::effect_v1::EffectV1;
use crate::item_table::ItemReferenceTable;
use crate::{common::char_array::CharArray, effect_v2::EffectV2Body};
use crate::{
item_table::ItemSlots,
model::Model,
Expand All @@ -26,8 +26,10 @@ pub struct Creature {
pub memorized_spell_info: Vec<SpellMemorizationInfo>,
#[br(count=header.count_of_memorized_spell_table, seek_before=SeekFrom::Start(header.offset_to_memorized_spell_table as u64))]
pub memorized_spells: Vec<SpellMemorizationTable>,
#[br(count=header.count_of_effects, seek_before=SeekFrom::Start(header.offset_to_effects as u64))]
pub effects: Vec<EffectV1>,
#[br(if(header.effstructure == 0), count=header.count_of_effects, seek_before=SeekFrom::Start(header.offset_to_effects as u64))]
pub effects_v1: Vec<EffectV1>,
#[br(if(header.effstructure == 1), count=header.count_of_effects, seek_before=SeekFrom::Start(header.offset_to_effects as u64))]
pub effects_v2: Vec<EffectV2Body>,
#[br(count=header.count_of_items, seek_before=SeekFrom::Start(header.offset_to_items as u64))]
pub item_table: Vec<ItemReferenceTable>,
#[br(seek_before=SeekFrom::Start(header.offset_to_item_slots as u64))]
Expand Down

0 comments on commit ef91554

Please sign in to comment.