Skip to content

Commit 32c4fc6

Browse files
authored
Merge pull request #1069 from endlessm/fix-talk-behavior
Slight improve for TalkBehavior node and default dialogue
2 parents d1264fd + b8e4ef9 commit 32c4fc6

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

project.godot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ gdscript/warnings/untyped_declaration=1
3535
editor/new_file_template="# SPDX-FileCopyrightText: The Threadbare Authors
3636
# SPDX-License-Identifier: MPL-2.0
3737
~ start
38-
{{npc_name}}: [[Hi|Hello|Greetings]], {{player_name}}
38+
[[Hi|Hello|Greetings]], {{player_name}}
3939
=> END
4040
"
4141
runtime/balloon_path="uid://dhydhpp43urah"

scenes/game_logic/talk_behavior.gd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ func _ready() -> void:
4242
return
4343
interact_area.interaction_started.connect(_on_interaction_started)
4444

45-
if get_parent() is NPC:
46-
var npc := get_parent() as NPC
47-
if npc.npc_name:
48-
interact_area.action = "Talk to %s" % npc.npc_name
45+
var npc := get_parent() as NPC
46+
if npc and npc.npc_name:
47+
interact_area.action = "Talk to %s" % npc.npc_name
4948

5049

5150
func _on_interaction_started(player: Player, _from_right: bool) -> void:

0 commit comments

Comments
 (0)