Fixed null error if there are no targets
This commit is contained in:
parent
bb89431807
commit
1719b56d8a
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue