Merge branch 'holychowders/fix_deadwood_attack' into 'master'

Fix deadwood not attacking if target is at a different elevation than deadwood.

See merge request veloren/veloren!3301
This commit is contained in:
Marcel 2022-03-27 20:02:38 +00:00
commit 8571c6c760
2 changed files with 3 additions and 2 deletions

View File

@ -373,6 +373,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed entities with voxel colliders being off by one physics tick for collision.
- Airships no longer oscillate dramatically into the sky due to mistaking velocity for acceleration.
- The login and character selection screens no longer cause high GPU usage when the framerate limit is set to Unlimited.
- Deadwood will now attack targets who are at different elevations than itself.
## [0.9.0] - 2021-03-20

View File

@ -2424,7 +2424,7 @@ impl<'a> AgentData<'a> {
// If already dashing, keep dashing and have move_dir set to forward
controller.push_basic_input(InputKind::Secondary);
controller.inputs.move_dir = self.ori.look_vec().xy();
} else if attack_data.in_min_range() && attack_data.angle < 10.0 {
} else if attack_data.in_min_range() && attack_data.angle_xy < 10.0 {
// If near target, dash at them and through them to get away
controller.push_basic_input(InputKind::Secondary);
} else if matches!(self.char_state, CharacterState::BasicBeam(s) if s.stage_section != StageSection::Recover && s.timer < BEAM_TIME)
@ -2433,7 +2433,7 @@ impl<'a> AgentData<'a> {
controller.push_basic_input(InputKind::Primary);
} else if attack_data.dist_sqrd < BEAM_RANGE.powi(2) {
// Else if in beam range, beam them
if attack_data.angle < 5.0 {
if attack_data.angle_xy < 5.0 {
controller.push_basic_input(InputKind::Primary);
} else {
// If not in angle, apply slight movement so deadwood orients itself correctly