mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
don't try to send events if the deck has been freed
This commit is contained in:
parent
db590acdb9
commit
cb1e30d6af
1 changed files with 12 additions and 3 deletions
|
@ -296,14 +296,23 @@ static func pre_exit_cleanup() -> void:
|
||||||
static func send_event(event_name: StringName, event_data: Dictionary = {}) -> void:
|
static func send_event(event_name: StringName, event_data: Dictionary = {}) -> void:
|
||||||
for deck_id: String in decks:
|
for deck_id: String in decks:
|
||||||
if decks[deck_id] is Deck:
|
if decks[deck_id] is Deck:
|
||||||
(decks[deck_id] as Deck).send_event(event_name, event_data)
|
var deck: Deck = (decks[deck_id] as Deck)
|
||||||
|
if not is_instance_valid(deck):
|
||||||
|
continue
|
||||||
|
deck.send_event(event_name, event_data)
|
||||||
else:
|
else:
|
||||||
for deck_instance_id: String in decks[deck_id]:
|
for deck_instance_id: String in decks[deck_id]:
|
||||||
(decks[deck_id][deck_instance_id] as Deck).send_event(event_name, event_data)
|
var deck: Deck = (decks[deck_id][deck_instance_id] as Deck)
|
||||||
|
if not is_instance_valid(deck):
|
||||||
|
continue
|
||||||
|
deck.send_event(event_name, event_data)
|
||||||
|
|
||||||
for lib_group_id: String in lib_groups:
|
for lib_group_id: String in lib_groups:
|
||||||
for lib_instance_id: String in lib_groups[lib_group_id]:
|
for lib_instance_id: String in lib_groups[lib_group_id]:
|
||||||
(lib_groups[lib_group_id][lib_instance_id] as Deck).send_event(event_name, event_data)
|
var deck: Deck = (lib_groups[lib_group_id][lib_instance_id] as Deck)
|
||||||
|
if not is_instance_valid(deck):
|
||||||
|
continue
|
||||||
|
deck.send_event(event_name, event_data)
|
||||||
|
|
||||||
|
|
||||||
#region group signal callbacks
|
#region group signal callbacks
|
||||||
|
|
Loading…
Reference in a new issue