mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Single target melee attacks now hit the closest target instead of a random target.
This commit is contained in:
parent
1e0dfe003d
commit
c09e858cba
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -6854,6 +6854,7 @@ version = "0.10.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"hashbrown 0.12.3",
|
"hashbrown 0.12.3",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
|
"itertools",
|
||||||
"ordered-float 3.1.0",
|
"ordered-float 3.1.0",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"rayon",
|
"rayon",
|
||||||
|
@ -1051,7 +1051,7 @@ pub fn handle_dodge_interrupt(
|
|||||||
// Check that the input used to enter current character state (if there was one)
|
// Check that the input used to enter current character state (if there was one)
|
||||||
// is not pressed
|
// is not pressed
|
||||||
if input_override
|
if input_override
|
||||||
.or(data.character.ability_info().map(|a| a.input))
|
.or_else(|| data.character.ability_info().map(|a| a.input))
|
||||||
.map_or(true, |input| !input_is_pressed(data, input))
|
.map_or(true, |input| !input_is_pressed(data, input))
|
||||||
{
|
{
|
||||||
// If there is a stage section, only roll during
|
// If there is a stage section, only roll during
|
||||||
|
@ -20,6 +20,7 @@ rayon = "1.5"
|
|||||||
tracing = { version = "0.1", default-features = false }
|
tracing = { version = "0.1", default-features = false }
|
||||||
vek = { version = "0.15.8", features = ["serde"] }
|
vek = { version = "0.15.8", features = ["serde"] }
|
||||||
ordered-float = { version = "3", default-features = false }
|
ordered-float = { version = "3", default-features = false }
|
||||||
|
itertools = "0.10"
|
||||||
|
|
||||||
# Data structures
|
# Data structures
|
||||||
hashbrown = { version = "0.12", features = ["rayon", "serde", "nightly"] }
|
hashbrown = { version = "0.12", features = ["rayon", "serde", "nightly"] }
|
||||||
|
@ -13,6 +13,7 @@ use common::{
|
|||||||
GroupTarget,
|
GroupTarget,
|
||||||
};
|
};
|
||||||
use common_ecs::{Job, Origin, Phase, System};
|
use common_ecs::{Job, Origin, Phase, System};
|
||||||
|
use itertools::Itertools;
|
||||||
use specs::{
|
use specs::{
|
||||||
shred::ResourceId, Entities, Join, Read, ReadStorage, SystemData, World, WriteStorage,
|
shred::ResourceId, Entities, Join, Read, ReadStorage, SystemData, World, WriteStorage,
|
||||||
};
|
};
|
||||||
@ -111,6 +112,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
&read_data.uids,
|
&read_data.uids,
|
||||||
)
|
)
|
||||||
.join()
|
.join()
|
||||||
|
.sorted_by_key(|(_, pos_b, _, _, _)| pos_b.0.distance_squared(pos.0) as u32)
|
||||||
{
|
{
|
||||||
// Unless the melee attack can hit multiple targets, stop the attack if it has
|
// Unless the melee attack can hit multiple targets, stop the attack if it has
|
||||||
// already hit 1 target
|
// already hit 1 target
|
||||||
|
Loading…
x
Reference in New Issue
Block a user