mirror of
https://github.com/redstrate/Kawari.git
synced 2025-04-19 22:36:49 +00:00
Show the currently equipped weapon on your character
Oops, I was turning u64 model ids into u16 and then changing it to either a u32/u16. That's stupid, but now it's fixed and we can display weapons!
This commit is contained in:
parent
510d07e3e4
commit
e5672e91f2
2 changed files with 8 additions and 3 deletions
|
@ -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<u16> {
|
||||
pub fn get_primary_model_id(&mut self, item_id: u32) -> Option<u64> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue