1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-07-10 07:57:46 +00:00

Address: "warning: the variable sequence is used as a loop counter"

This commit is contained in:
The Dax 2025-06-30 20:36:57 -04:00 committed by Joshua Goins
parent b0282eb6bc
commit d14dd3ccd9
2 changed files with 10 additions and 9 deletions

View file

@ -479,9 +479,10 @@ impl ZoneConnection {
} }
pub async fn send_inventory(&mut self, send_appearance_update: bool) { pub async fn send_inventory(&mut self, send_appearance_update: bool) {
let mut sequence = 0; for (sequence, (container_type, container)) in (&self.player_data.inventory.clone())
.into_iter()
for (container_type, container) in &self.player_data.inventory.clone() { .enumerate()
{
// currencies // currencies
if container_type == ContainerType::Currency { if container_type == ContainerType::Currency {
let mut send_currency = async |item: &Item| { let mut send_currency = async |item: &Item| {
@ -489,7 +490,7 @@ impl ZoneConnection {
op_code: ServerZoneIpcType::CurrencyCrystalInfo, op_code: ServerZoneIpcType::CurrencyCrystalInfo,
timestamp: timestamp_secs(), timestamp: timestamp_secs(),
data: ServerZoneIpcData::CurrencyCrystalInfo(CurrencyInfo { data: ServerZoneIpcData::CurrencyCrystalInfo(CurrencyInfo {
sequence, sequence: sequence as u32,
container: container_type, container: container_type,
quantity: item.quantity, quantity: item.quantity,
catalog_id: item.id, catalog_id: item.id,
@ -519,7 +520,7 @@ impl ZoneConnection {
op_code: ServerZoneIpcType::UpdateItem, op_code: ServerZoneIpcType::UpdateItem,
timestamp: timestamp_secs(), timestamp: timestamp_secs(),
data: ServerZoneIpcData::UpdateItem(ItemInfo { data: ServerZoneIpcData::UpdateItem(ItemInfo {
sequence, sequence: sequence as u32,
container: container_type, container: container_type,
slot: slot_index, slot: slot_index,
quantity: item.quantity, quantity: item.quantity,
@ -553,7 +554,7 @@ impl ZoneConnection {
data: ServerZoneIpcData::ContainerInfo(ContainerInfo { data: ServerZoneIpcData::ContainerInfo(ContainerInfo {
container: container_type, container: container_type,
num_items: container.num_items(), num_items: container.num_items(),
sequence, sequence: sequence as u32,
..Default::default() ..Default::default()
}), }),
..Default::default() ..Default::default()
@ -567,8 +568,6 @@ impl ZoneConnection {
}) })
.await; .await;
} }
sequence += 1;
} }
// send them an appearance update // send them an appearance update

View file

@ -309,7 +309,9 @@ pub async fn server_main_loop(mut recv: Receiver<ToServer>) -> Result<(), std::i
// handle player-to-server actions // handle player-to-server actions
if id == from_id { 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 { let msg = FromServer::ActorControlSelf(ActorControlSelf {
category: ActorControlCategory::TeleportStart { category: ActorControlCategory::TeleportStart {
insufficient_gil: 0, insufficient_gil: 0,