From 7b0fe752fb235d4aaaa150408cd3c19638f6cb8c Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 16 Nov 2019 23:10:18 -0800 Subject: [PATCH] defaults for character and fullcharacter --- src/character/character.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/character/character.rs b/src/character/character.rs index ac79bbb..4d5a7ac 100644 --- a/src/character/character.rs +++ b/src/character/character.rs @@ -79,6 +79,12 @@ impl Character { } } +impl std::default::Default for Character { + fn default() -> Character { + Character::from_bytes(&mut std::io::Cursor::new([0; 0x2000].to_vec())).unwrap() + } +} + #[derive(Copy, Clone, Debug, PartialEq)] #[repr(C)] pub struct SelectScreenCharacter { @@ -257,6 +263,12 @@ pub struct FullCharacter { pub key_team_config: KeyTeamConfig, } +impl std::default::Default for FullCharacter { + fn default() -> FullCharacter { + FullCharacter::from_bytes(&mut std::io::Cursor::new([0; 0x3998].to_vec())).unwrap() + } +} + #[derive(PSOPacketData, Copy, Clone)] pub struct DBChar { pub inventory: Inventory,