Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional safety checks #2325

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/dialogic/Modules/Character/subsystem_portraits.gd
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ func leave_all_characters(animation_name:="", animation_length:=0.0, animation_w
## Return `null` if the [param character] is not part of the scene.
func get_character_node(character: DialogicCharacter) -> Node:
if is_character_joined(character):
return dialogic.current_state_info['portraits'][character.resource_path].node

if is_instance_valid(dialogic.current_state_info['portraits'][character.resource_path].node):
return dialogic.current_state_info['portraits'][character.resource_path].node
return null


Expand Down
3 changes: 1 addition & 2 deletions addons/dialogic/Modules/Voice/subsystem_voice.gd
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ func _ready() -> void:
## Whether the current event is a text event and has a voice
## event before it.
func is_voiced(index: int) -> bool:
if dialogic.current_timeline_events[index] is DialogicTextEvent:

if index > 0 and dialogic.current_timeline_events[index] is DialogicTextEvent:
if dialogic.current_timeline_events[index-1] is DialogicVoiceEvent:
return true

Expand Down
Loading