mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Make agents use controller correctly
This commit is contained in:
parent
d235374d8e
commit
ccbacabd2f
@ -41,9 +41,7 @@ impl<'a> System<'a> for Sys {
|
||||
let tgt_pos = tgt_pos.0 + *offset;
|
||||
|
||||
if tgt_pos.z > pos.0.z + 1.0 {
|
||||
if let Err(err) = jumps.insert(entity, Jumping) {
|
||||
warn!("Inserting Jumping for an entity failed: {:?}", err,);
|
||||
}
|
||||
controller.jump = true;
|
||||
}
|
||||
|
||||
// Move towards the target.
|
||||
@ -74,9 +72,7 @@ impl<'a> System<'a> for Sys {
|
||||
controller.move_dir = Vec2::zero();
|
||||
|
||||
if rand::random::<f32>() < 0.2 {
|
||||
attacks
|
||||
.insert(entity, Attacking::start())
|
||||
.expect("Inserting attacking for an entity failed!");
|
||||
controller.attack = true;
|
||||
}
|
||||
|
||||
false
|
||||
|
Loading…
Reference in New Issue
Block a user