Fixed null error if there are no targets

This commit is contained in:
Stedd 2024-10-05 17:07:22 +02:00
parent bb89431807
commit 1719b56d8a
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,8 @@ namespace AsteroidGame.Entities
public bool FindTarget()
{
if (_activeTargetable == null || _activeTargetable.Count == 0) return false;
var currentBestValue = Mathf.Infinity;
var targetFound = false;