Merge branch 'kalculate/attacking-the-dead' into 'master'

Fixing #504 - Enemies stop attacking after combat

Closes #504

See merge request veloren/veloren!820
This commit is contained in:
Imbris 2020-02-26 05:35:55 +00:00
commit 0d189cb546
2 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added gamma setting
- Added new orc hairstyles
- Added sfx for wielding/unwielding weapons
- Fixed NPCs attacking the player forever after killing them
### Changed

View File

@ -153,7 +153,7 @@ impl<'a> System<'a> for Sys {
been_close,
..
} => {
if let (Some(tgt_pos), _tgt_stats, tgt_alignment) = (
if let (Some(tgt_pos), Some(tgt_stats), tgt_alignment) = (
positions.get(*target),
stats.get(*target),
alignments
@ -164,7 +164,8 @@ impl<'a> System<'a> for Sys {
// Don't attack entities we are passive towards
// TODO: This is here, it's a bit of a hack
if let Some(alignment) = alignment {
if (*alignment).passive_towards(tgt_alignment) {
if (*alignment).passive_towards(tgt_alignment) || tgt_stats.is_dead
{
do_idle = true;
break 'activity;
}