Make projectiles function properly if they hit a wall in the same tick as an entity.

This commit is contained in:
Avi Weinstock 2021-05-07 18:56:18 -04:00
parent a2999ce96f
commit 7ec7540be4
2 changed files with 6 additions and 4 deletions

View File

@ -118,6 +118,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Burning Debuff icon is now displayed correctly. - Burning Debuff icon is now displayed correctly.
- Villagers in safezones no longer spam messages upon seeing an enemy - Villagers in safezones no longer spam messages upon seeing an enemy
- Wolf AI will no longer circle into walls and will instead use the power of raycasts to stop early - Wolf AI will no longer circle into walls and will instead use the power of raycasts to stop early
- Squirrels are no longer immune to arrows at some angles.
## [0.9.0] - 2021-03-20 ## [0.9.0] - 2021-03-20

View File

@ -111,10 +111,11 @@ impl<'a> System<'a> for Sys {
.uid_allocator .uid_allocator
.retrieve_entity_internal(other.into()) .retrieve_entity_internal(other.into())
{ {
if let (Some(pos), Some(dir)) = ( if let (Some(pos), Some(ori)) =
read_data.positions.get(target), (read_data.positions.get(target), orientations.get(entity))
Dir::from_unnormalized(vel.0), {
) { let dir = ori.look_dir();
let owner_entity = projectile.owner.and_then(|u| { let owner_entity = projectile.owner.and_then(|u| {
read_data.uid_allocator.retrieve_entity_internal(u.into()) read_data.uid_allocator.retrieve_entity_internal(u.into())
}); });