From 54feb2ce55d399f990a8e2008b939413f9364536 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Mon, 12 May 2025 21:02:55 -0500 Subject: [PATCH] Fixed last bugs --- scripts/Entity/BasicNPCEntity.gd | 8 +++++++- scripts/Entity/Component/EntityInteractor.gd | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/Entity/BasicNPCEntity.gd b/scripts/Entity/BasicNPCEntity.gd index 265c995..38af235 100644 --- a/scripts/Entity/BasicNPCEntity.gd +++ b/scripts/Entity/BasicNPCEntity.gd @@ -7,10 +7,16 @@ func _ready() -> void: self.onEntityInteract ) +func _exit_tree() -> void: + $Entity/EntityInteractable.onInteract.disconnect( + self.onEntityInteract + ) + func onEntityInteract( interactor:EntityInteractor, interactee:EntityInteractable ) -> void: - if interactEvent == null || interactEvent.started: + if interactEvent == null || (interactEvent.started && !interactEvent.isDone()): return + interactEvent.onEntityInteract(interactor, $Entity/EntityInteractable) diff --git a/scripts/Entity/Component/EntityInteractor.gd b/scripts/Entity/Component/EntityInteractor.gd index b353654..fa8e354 100644 --- a/scripts/Entity/Component/EntityInteractor.gd +++ b/scripts/Entity/Component/EntityInteractor.gd @@ -14,7 +14,6 @@ enum InteractorType { func interactWith(interactable:EntityInteractable) -> void: interactable.interact(self) - pass func getRaycastInteractable() -> EntityInteractable: if !entityDirection or !characterBody: