From 39d5a73c10b67308637c82cc15f55756c4405575 Mon Sep 17 00:00:00 2001 From: holychowders Date: Sun, 27 Mar 2022 20:02:38 +0000 Subject: [PATCH] Fix deadwood not attacking if target is at a different elevation than deadwood. --- CHANGELOG.md | 1 + server/src/sys/agent/attack.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfefd263c9..19124157b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -372,6 +372,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 diff --git a/server/src/sys/agent/attack.rs b/server/src/sys/agent/attack.rs index 6273a95464..d0e86876e7 100644 --- a/server/src/sys/agent/attack.rs +++ b/server/src/sys/agent/attack.rs @@ -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