mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 15:53:42 +00:00
interactions work
This commit is contained in:
parent
534fd48093
commit
5ffff57b5f
@ -14,6 +14,9 @@ void InteractionComponent::update() {}
|
|||||||
|
|
||||||
bool InteractionComponent::interact(Entity* interactor, Entity* interactee)
|
bool InteractionComponent::interact(Entity* interactor, Entity* interactee)
|
||||||
{
|
{
|
||||||
|
if(interactee == nullptr)
|
||||||
|
return false;
|
||||||
|
|
||||||
if(!interactor->hasComponent<InteractionComponent>() || !interactor->getComponent<InteractionComponent>().canInteract)
|
if(!interactor->hasComponent<InteractionComponent>() || !interactor->getComponent<InteractionComponent>().canInteract)
|
||||||
throw std::logic_error("Interactor entity cannot interact");
|
throw std::logic_error("Interactor entity cannot interact");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user