From f92758ce3df3c72a836dc259812f1083864dc542 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 3 May 2020 00:10:41 +0200 Subject: [PATCH] Fix potential crash. --- entities/entity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entities/entity.cpp b/entities/entity.cpp index 442a7a0..e93c874 100644 --- a/entities/entity.cpp +++ b/entities/entity.cpp @@ -5459,7 +5459,7 @@ void Entity::update(float delta) { } } - if (_s_entity_controller == EntityEnums::ENITIY_CONTROLLER_AI && _s_ai->get_enabled()) { + if (_s_entity_controller == EntityEnums::ENITIY_CONTROLLER_AI && _s_ai.is_valid() && _s_ai->get_enabled()) { if (_s_pet_owner) _s_ai->pet_update(delta); else