merge commit. Added fix player and monsters

This commit is contained in:
bmvolf 2023-08-18 11:50:24 +03:00
parent c05d13a68b
commit dcc845a517

View file

@ -147,7 +147,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
{
StartCicycleAnimation("playerShootRight");
var targets = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)(Pos.Y - 10f), shootLength + 24, 10), typeof(Zombie)).OrderBy(x => (x.Pos - Pos).LengthSquared());
if (targets != null)
if (targets.Count() > 0)
{
Zombie targetZombie = (Zombie)targets.First();
targetZombie.TakeDamage();