Skip to content

Commit aeb5a72

Browse files
Fixed a bug where the game will crash if an entity dies while casting the Evil Eye
1 parent 15417d6 commit aeb5a72

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Spells/EvilSight.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ func _physics_process(delta):
3131
var pos := get_collision_point()
3232
var pos2 := get_collision_point()
3333
if get_collider().is_in_group("World"):
34-
Caster.speed -= (pos-position).normalized()*10
34+
if is_instance_valid(Caster):
35+
Caster.speed -= (pos-position).normalized()*10
3536
pos.x = int(pos.x/8)
3637
pos.y = int(pos.y/8)
3738
for x in range(-2, 3):

0 commit comments

Comments
 (0)