From 387d20ba925135d72b0d3b3175ecf0ca6212b581 Mon Sep 17 00:00:00 2001 From: Julian Murgia Date: Wed, 28 Jul 2021 15:38:54 +0200 Subject: [PATCH] Fix inputs on player CollisionShape2D node causing a crash (#334) * Fix inputs on player CollisionShape2D node causing a crash * docs: Automatic update of API docs Co-authored-by: StraToN --- addons/escoria-core/game/core-scripts/esc_player.gd | 6 ++++++ docs/esc.md | 1 + 2 files changed, 7 insertions(+) diff --git a/addons/escoria-core/game/core-scripts/esc_player.gd b/addons/escoria-core/game/core-scripts/esc_player.gd index b311ca08..76b0d80f 100644 --- a/addons/escoria-core/game/core-scripts/esc_player.gd +++ b/addons/escoria-core/game/core-scripts/esc_player.gd @@ -17,6 +17,12 @@ func _init(): is_movable = true +# Ready function +func _ready(): + # For ESCPlayer, avoid the CollisionShape2D used for movement to catch inputs + disconnect("input_event", self, "manage_input") + + # Return the camera position if a camera_position_node exists or the # global position of the player func get_camera_pos(): diff --git a/docs/esc.md b/docs/esc.md index 715ba3b1..e892270a 100644 --- a/docs/esc.md +++ b/docs/esc.md @@ -405,6 +405,7 @@ Makes the `player` walk to the position `x`/`y`. + ## Dialogs Dialogs are specified by writing `?` with optional parameters, followed by a list of dialog options starting with `-`. Use `!` to end the dialog.