Fix input being blocked when item is not interactive #91 (#481)

This commit is contained in:
Julian Murgia
2021-12-14 07:23:37 +01:00
committed by GitHub
parent c7ea9318a4
commit 92e38b245e

View File

@@ -271,14 +271,8 @@ func _ready():
# - event: Triggered event
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.is_pressed():
if not escoria.current_state == escoria.GAME_STATE.DEFAULT or \
not is_interactive:
escoria.logger.info(
(
"Item %s is not interactive or the game state doesn't " +
"accept interactions"
) % global_id
)
if not escoria.current_state == escoria.GAME_STATE.DEFAULT:
escoria.logger.info("Game state doesn't accept interactions")
return
var p = get_global_mouse_position()
var mouse_in_shape: bool = false