diff --git a/src/common/gamedata.rs b/src/common/gamedata.rs index 983a838..f8579bd 100644 --- a/src/common/gamedata.rs +++ b/src/common/gamedata.rs @@ -107,7 +107,7 @@ impl GameData { } /// Gets the primary model ID for a given item ID - pub fn get_primary_model_id(&mut self, item_id: u32) -> Option { + pub fn get_primary_model_id(&mut self, item_id: u32) -> Option { for page in &self.item_pages { if let Some(row) = page.read_row(&self.item_exh, item_id) { let item_row = &row[0]; @@ -116,7 +116,7 @@ impl GameData { panic!("Unexpected type!"); }; - return Some(*id as u16); + return Some(*id); } } diff --git a/src/world/connection.rs b/src/world/connection.rs index 3808ceb..141ddba 100644 --- a/src/world/connection.rs +++ b/src/world/connection.rs @@ -621,7 +621,9 @@ impl ZoneConnection { op_code: ServerZoneIpcType::Equip, timestamp: timestamp_secs(), data: ServerZoneIpcData::Equip(Equip { - main_weapon_id: 0, + main_weapon_id: game_data + .get_primary_model_id(equipped.main_hand.id) + .unwrap_or(0), sub_weapon_id: 0, crest_enable: 0, pattern_invalid: 0, @@ -797,6 +799,9 @@ impl ZoneConnection { object_kind: ObjectKind::Player(PlayerSubKind::Player), look: chara_details.chara_make.customize, display_flags: DisplayFlag::UNK, + main_weapon_model: game_data + .get_primary_model_id(equipped.main_hand.id) + .unwrap_or(0), models: [ game_data .get_primary_model_id(equipped.head.id)