mirror of
https://github.com/redstrate/Kawari.git
synced 2025-07-10 16:07:45 +00:00
Address: "warning: the variable sequence
is used as a loop counter"
This commit is contained in:
parent
b0282eb6bc
commit
d14dd3ccd9
2 changed files with 10 additions and 9 deletions
|
@ -479,9 +479,10 @@ impl ZoneConnection {
|
|||
}
|
||||
|
||||
pub async fn send_inventory(&mut self, send_appearance_update: bool) {
|
||||
let mut sequence = 0;
|
||||
|
||||
for (container_type, container) in &self.player_data.inventory.clone() {
|
||||
for (sequence, (container_type, container)) in (&self.player_data.inventory.clone())
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
{
|
||||
// currencies
|
||||
if container_type == ContainerType::Currency {
|
||||
let mut send_currency = async |item: &Item| {
|
||||
|
@ -489,7 +490,7 @@ impl ZoneConnection {
|
|||
op_code: ServerZoneIpcType::CurrencyCrystalInfo,
|
||||
timestamp: timestamp_secs(),
|
||||
data: ServerZoneIpcData::CurrencyCrystalInfo(CurrencyInfo {
|
||||
sequence,
|
||||
sequence: sequence as u32,
|
||||
container: container_type,
|
||||
quantity: item.quantity,
|
||||
catalog_id: item.id,
|
||||
|
@ -519,7 +520,7 @@ impl ZoneConnection {
|
|||
op_code: ServerZoneIpcType::UpdateItem,
|
||||
timestamp: timestamp_secs(),
|
||||
data: ServerZoneIpcData::UpdateItem(ItemInfo {
|
||||
sequence,
|
||||
sequence: sequence as u32,
|
||||
container: container_type,
|
||||
slot: slot_index,
|
||||
quantity: item.quantity,
|
||||
|
@ -553,7 +554,7 @@ impl ZoneConnection {
|
|||
data: ServerZoneIpcData::ContainerInfo(ContainerInfo {
|
||||
container: container_type,
|
||||
num_items: container.num_items(),
|
||||
sequence,
|
||||
sequence: sequence as u32,
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
|
@ -567,8 +568,6 @@ impl ZoneConnection {
|
|||
})
|
||||
.await;
|
||||
}
|
||||
|
||||
sequence += 1;
|
||||
}
|
||||
|
||||
// send them an appearance update
|
||||
|
|
|
@ -309,7 +309,9 @@ pub async fn server_main_loop(mut recv: Receiver<ToServer>) -> Result<(), std::i
|
|||
|
||||
// handle player-to-server actions
|
||||
if id == from_id {
|
||||
if let ClientTriggerCommand::TeleportQuery { aetheryte_id } = &trigger.trigger {
|
||||
if let ClientTriggerCommand::TeleportQuery { aetheryte_id } =
|
||||
&trigger.trigger
|
||||
{
|
||||
let msg = FromServer::ActorControlSelf(ActorControlSelf {
|
||||
category: ActorControlCategory::TeleportStart {
|
||||
insufficient_gil: 0,
|
||||
|
|
Loading…
Add table
Reference in a new issue