mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'zesterer/fix-pets' into 'master'
Fix pets without agency See merge request veloren/veloren!2728
This commit is contained in:
commit
33e9bc79e3
@ -49,8 +49,11 @@ fn tame_pet_internal(ecs: &specs::World, pet_entity: Entity, owner: Entity, pet:
|
||||
.write_storage()
|
||||
.insert(pet_entity, pet.unwrap_or_default());
|
||||
|
||||
if let Some(agent) = ecs.write_storage::<Agent>().get_mut(pet_entity) {
|
||||
agent.set_no_flee();
|
||||
// Create an agent for this entity using its body
|
||||
if let Some(body) = ecs.read_storage().get(pet_entity) {
|
||||
let _ = ecs
|
||||
.write_storage()
|
||||
.insert(pet_entity, Agent::from_body(body));
|
||||
}
|
||||
|
||||
// Add to group system
|
||||
|
Loading…
Reference in New Issue
Block a user