From 5ffff57b5fcbbf7f596386d7e92a2f75b8250c4a Mon Sep 17 00:00:00 2001 From: ineslelin Date: Tue, 14 Jan 2025 22:17:52 +0100 Subject: [PATCH] interactions work --- src/InteractionComponent.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/InteractionComponent.cpp b/src/InteractionComponent.cpp index 03ace7b..190e3d8 100644 --- a/src/InteractionComponent.cpp +++ b/src/InteractionComponent.cpp @@ -14,6 +14,9 @@ void InteractionComponent::update() {} bool InteractionComponent::interact(Entity* interactor, Entity* interactee) { + if(interactee == nullptr) + return false; + if(!interactor->hasComponent() || !interactor->getComponent().canInteract) throw std::logic_error("Interactor entity cannot interact");