Skip to content

Commit

Permalink
Don't crash if galaxy map nodes/edges are clicked and player is destr…
Browse files Browse the repository at this point in the history
…oyed
  • Loading branch information
jspahrsummers committed Jul 18, 2024
1 parent 8b0cc74 commit f0ffbad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions galaxy/map/galaxy_map.gd
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func _on_window_close_requested() -> void:
self.queue_free()

func _on_system_clicked(star_system: StarSystem, _system_node: GalaxyMapSystem) -> void:
if self.hyperdrive_system.jumping:
if not is_instance_valid(self.hyperdrive_system) or self.hyperdrive_system.jumping:
return

if star_system.name not in self.hyperdrive_system.current_system().connections:
Expand All @@ -76,7 +76,7 @@ func _on_system_clicked(star_system: StarSystem, _system_node: GalaxyMapSystem)
self.hyperdrive_system.jump_destination = star_system

func _on_hyperlane_clicked(from_system: StarSystem, to_system: StarSystem, _hyperlane_node: GalaxyMapHyperlane) -> void:
if self.hyperdrive_system.jumping:
if not is_instance_valid(self.hyperdrive_system) or self.hyperdrive_system.jumping:
return

var current_system := self.hyperdrive_system.current_system()
Expand Down

0 comments on commit f0ffbad

Please sign in to comment.