Add basic distance check to shockwave hit test

Before checking if the entity hitbox intersects the shockwave shell, we
do a basic check that the entity is close enough to be hit, considering
its radius.

This fixes the unlimited vertical range problem, since the distance is
measured in 3D.
This commit is contained in:
Ygor Souza 2021-04-24 02:35:44 +02:00 committed by Avi Weinstock
parent e3e38ca9e1
commit 65fdbc1d69
2 changed files with 2 additions and 0 deletions

View File

@ -95,6 +95,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Minimap icons are now displayed in both map modes
- Server now denies any running trades when a user exits to the character selection screen.
- Sfx volume changes now also change the ambient sounds volume
- Staff fire shockwave ability no longer has an unlimited vertical range
## [0.9.0] - 2021-03-20

View File

@ -164,6 +164,7 @@ impl<'a> System<'a> for Sys {
// Check if it is a hit
let hit = entity != target
&& !health_b.is_dead
&& (pos_b.0 - pos.0).magnitude() < frame_end_dist + rad_b
// Collision shapes
&& {
// TODO: write code to collide rect with the arc strip so that we can do