//! Cargo systems: carry visual cycling, position sync, and haul encumbrance. use bevy::prelude::*; use crate::entities::cargo::components::{Cargo, CarryVisualState, HaulSlot}; use crate::entities::item::constants::ITEM_Z_FIGHTING_OFFSET; use crate::entities::item::inventory::constants::ENCUMBERED_SPEED_MULTIPLIER; use crate::entities::item::inventory::InventoryChangedEvent; use crate::entities::shared_components::Ambulatory; /// Returns true if any entity has an occupied HaulSlot. /// Used to gate carry_visual_system — skips entire system when no one is hauling. pub fn any_hauling(query: Query<&HaulSlot>) -> bool { query.iter().any(|slot| slot.is_occupied()) } /// Cycle the carry visual sprite while the entity's HaulSlot is occupied. /// When empty, ensure the normal sprite is restored. /// /// Runs in Update (visual only, no game state change). /// Only runs when at least one entity has an occupied HaulSlot. pub fn carry_visual_system( time: Res