From bf28679b951d23ab0adc655b75ab2ba72200db79 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 4 Jan 2020 13:27:45 +0100 Subject: [PATCH] Fix performance issue with the AI. --- entities/ai/entity_ai.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entities/ai/entity_ai.cpp b/entities/ai/entity_ai.cpp index 679baea..fefb37c 100644 --- a/entities/ai/entity_ai.cpp +++ b/entities/ai/entity_ai.cpp @@ -10,6 +10,9 @@ void EntityAI::set_enabled(bool value) { } void EntityAI::set_owner(Entity *entity) { + if (entity == _owner) + return; + _owner = entity; call("_on_set_owner");