Skip to content

Commit

Permalink
Merge pull request #225 from NancokPS2/crash-on-leash
Browse files Browse the repository at this point in the history
Fixed crash when a fleeing enemy looses the reference to its attacker.
  • Loading branch information
jonathaneeckhout authored Jan 11, 2024
2 parents 2cf738e + 2581785 commit 0493b9f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ func flee():
if not fleeing:
return

# The _attacker could not be found, it likely despawned.
if not is_instance_valid(_attacker):
return

# Calculate the speed while fleeing
var flee_speed: float = _stats_component.movement_speed * _flee_speed_boost

Expand Down

0 comments on commit 0493b9f

Please sign in to comment.