Fixed hang when TweenChannel.sync is called too late.

This commit is contained in:
blujai831 2024-01-24 12:13:09 -08:00
parent eb720b6188
commit 14e4ea41fb
No known key found for this signature in database
GPG Key ID: DDC31A0363AA5E66
1 changed files with 4 additions and 3 deletions

View File

@ -70,9 +70,10 @@ func create_tween(target: Variant) -> Tween:
##
## The given tween must have been created with self.create_tween.
func sync(what: Tween) -> void:
var last_terminated: Tween = null
while last_terminated != what:
last_terminated = await terminated
if what and what.is_valid():
var last_terminated: Tween = null
while last_terminated != what:
last_terminated = await terminated
## Yields until the given tween is invalid and then cleans up bookkeeping.
##