mirror of
https://github.com/redstrate/Kawari.git
synced 2025-07-10 16:07:45 +00:00
Fix a small issue with the !equip command
-It wasn't setting the item's condition, causing the game UI to behave strangely when looking at the item's tooltip -Added a constant for the maximum item durability
This commit is contained in:
parent
85f0a0cd49
commit
7801398590
3 changed files with 11 additions and 13 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
use crate::ITEM_CONDITION_MAX;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// Represents an item, or if the quanity is zero an empty slot.
|
/// Represents an item, or if the quanity is zero an empty slot.
|
||||||
|
@ -14,7 +15,7 @@ impl Item {
|
||||||
Self {
|
Self {
|
||||||
quantity,
|
quantity,
|
||||||
id,
|
id,
|
||||||
condition: 30000,
|
condition: ITEM_CONDITION_MAX,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,9 @@ pub const AETHERYTE_UNLOCK_BITMASK_SIZE: usize = 30;
|
||||||
/// The size of the completed quest bitmask.
|
/// The size of the completed quest bitmask.
|
||||||
pub const COMPLETED_QUEST_BITMASK_SIZE: usize = 691;
|
pub const COMPLETED_QUEST_BITMASK_SIZE: usize = 691;
|
||||||
|
|
||||||
|
/// The maximum durability of an item.
|
||||||
|
pub const ITEM_CONDITION_MAX: u16 = 30000;
|
||||||
|
|
||||||
/// The operation opcode/type when discarding an item from the inventory.
|
/// The operation opcode/type when discarding an item from the inventory.
|
||||||
pub const INVENTORY_ACTION_DISCARD: u8 = 145;
|
pub const INVENTORY_ACTION_DISCARD: u8 = 145;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
|
ITEM_CONDITION_MAX,
|
||||||
common::ItemInfoQuery,
|
common::ItemInfoQuery,
|
||||||
inventory::{Item, Storage},
|
inventory::{Item, Storage},
|
||||||
ipc::zone::{ChatMessage, GameMasterRank},
|
ipc::zone::{ChatMessage, GameMasterRank},
|
||||||
|
@ -65,18 +66,11 @@ impl ChatHandler {
|
||||||
.get_equipslot_category(item_info.equip_category)
|
.get_equipslot_category(item_info.equip_category)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
connection
|
let slot = connection.player_data.inventory.equipped.get_slot_mut(slot);
|
||||||
.player_data
|
|
||||||
.inventory
|
slot.id = item_info.id;
|
||||||
.equipped
|
slot.quantity = 1;
|
||||||
.get_slot_mut(slot)
|
slot.condition = ITEM_CONDITION_MAX;
|
||||||
.id = item_info.id;
|
|
||||||
connection
|
|
||||||
.player_data
|
|
||||||
.inventory
|
|
||||||
.equipped
|
|
||||||
.get_slot_mut(slot)
|
|
||||||
.quantity = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue