Added check on "arrived" event in Movable so that the right context continues, not others.

To continue: move walk_* variables in ESCPlayer into Movable makes camera go wrong.
This commit is contained in:
Julian Murgia
2021-01-27 17:02:13 +01:00
parent 41e289cce9
commit 183439337a
12 changed files with 120 additions and 58 deletions

View File

@@ -240,7 +240,9 @@ func ev_left_click_on_item(obj, event, default_action = false):
main.current_scene.player.walk_to(destination_position, walk_context)
# Wait for the player to arrive before continuing with action.
yield(main.current_scene.player, "arrived")
var context = yield(main.current_scene.player, "arrived")
if context.target_object != walk_context.target_object:
dont_interact = true
# If no interaction should happen after player has arrived, leave immediately.
if dont_interact: