mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Inventory changes that modify the loadout now go through a control action instead of a control event.
This commit is contained in:
@ -4,7 +4,7 @@ use crate::{
|
||||
item::{Hands, ItemKind, Tool, ToolKind},
|
||||
quadruped_low, quadruped_medium,
|
||||
skills::{AxeSkill, BowSkill, HammerSkill, Skill, StaffSkill, SwordSkill},
|
||||
theropod, Body, CharacterState, StateUpdate,
|
||||
theropod, Body, CharacterState, InventoryManip, StateUpdate,
|
||||
},
|
||||
consts::{FRIC_GROUND, GRAVITY},
|
||||
event::LocalEvent,
|
||||
@ -359,6 +359,11 @@ pub fn attempt_swap_loadout(data: &JoinData, update: &mut StateUpdate) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Handles inventory manipulations that affect the loadout
|
||||
pub fn handle_modify_loadout(update: &mut StateUpdate, inv_manip: InventoryManip) {
|
||||
update.modify_loadout = Some(inv_manip);
|
||||
}
|
||||
|
||||
/// Checks that player can wield the glider and updates `CharacterState` if so
|
||||
pub fn attempt_glide_wield(data: &JoinData, update: &mut StateUpdate) {
|
||||
if data.inventory.equipped(EquipSlot::Glider).is_some()
|
||||
|
Reference in New Issue
Block a user