From e445db9aed3d1d59a73a8bc21d39f59930b2b5cb Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 11 Dec 2019 16:01:35 -0800 Subject: [PATCH] add some defaults --- src/character/character.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/character/character.rs b/src/character/character.rs index 47b9f5d..ec2559c 100644 --- a/src/character/character.rs +++ b/src/character/character.rs @@ -248,7 +248,7 @@ pub struct BankItem { pub flags: u16, } -#[derive(PSOPacketData, Copy, Clone)] +#[derive(PSOPacketData, Default, Copy, Clone)] pub struct Inventory { pub item_count: u8, pub hp_mats_used: u8, @@ -279,6 +279,12 @@ pub struct KeyTeamConfig { pub team_rewards: [u32; 2], } +impl std::default::Default for KeyTeamConfig { + fn default() -> KeyTeamConfig { + KeyTeamConfig::from_bytes(&mut std::io::Cursor::new([0; 0xAF4].to_vec())).unwrap() + } +} + #[derive(PSOPacketData, Copy, Clone)] pub struct Player { pub inventory: Inventory,