Merge branch 'qutrin/projectile-betrayal-fix' into 'master'

Prevent arrows from hitting their owners

Closes #383

See merge request veloren/veloren!891
This commit is contained in:
Forest Anderson 2020-04-06 22:19:02 +00:00
commit dea7fd4549
2 changed files with 8 additions and 3 deletions

View File

@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Overhauled icon art
- Asset cleanup to lower client-size
- Rewrote the humanoid skeleton to be more ideal for attack animations
- Arrows can no longer hurt their owners
### Removed

View File

@ -100,7 +100,9 @@ impl<'a> System<'a> for Sys {
for effect in projectile.hit_entity.drain(..) {
match effect {
projectile::Effect::Damage(change) => {
server_emitter.emit(ServerEvent::Damage { uid: other, change })
if other != projectile.owner.unwrap() {
server_emitter.emit(ServerEvent::Damage { uid: other, change });
}
},
projectile::Effect::Knockback(knockback) => {
if let Some(entity) =
@ -134,9 +136,11 @@ impl<'a> System<'a> for Sys {
cause: HealthSource::World,
}),
projectile::Effect::Possess => {
if other != projectile.owner.unwrap() {
if let Some(owner) = projectile.owner {
server_emitter.emit(ServerEvent::Possess(owner.into(), other));
}
}
},
_ => {},
}