fix: guard for cases where no animations are set.
This commit is contained in:
@@ -453,7 +453,8 @@ func turn_to(object: Node, wait: float = 0.0):
|
|||||||
# Play the talking animation
|
# Play the talking animation
|
||||||
func start_talking():
|
func start_talking():
|
||||||
# Only start the speaking animation if we actually have them setup
|
# Only start the speaking animation if we actually have them setup
|
||||||
if animations.speaks.size() > 0 \
|
if animations.speaks != null \
|
||||||
|
and animations.speaks.size() > 0 \
|
||||||
and get_animation_player() \
|
and get_animation_player() \
|
||||||
and _movable.last_dir >= 0 \
|
and _movable.last_dir >= 0 \
|
||||||
and _movable.last_dir < animations.speaks.size():
|
and _movable.last_dir < animations.speaks.size():
|
||||||
@@ -466,7 +467,8 @@ func start_talking():
|
|||||||
|
|
||||||
# Stop playing the talking animation
|
# Stop playing the talking animation
|
||||||
func stop_talking():
|
func stop_talking():
|
||||||
if animations.speaks.size() > 0 \
|
if animations.speaks != null \
|
||||||
|
and animations.speaks.size() > 0 \
|
||||||
and get_animation_player() \
|
and get_animation_player() \
|
||||||
and _movable.last_dir >= 0 \
|
and _movable.last_dir >= 0 \
|
||||||
and _movable.last_dir < animations.speaks.size():
|
and _movable.last_dir < animations.speaks.size():
|
||||||
|
|||||||
Reference in New Issue
Block a user