From ace7afa124407331ffe954d0683b8e58e535c63c Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Sun, 18 Jun 2017 19:12:52 +0300 Subject: [PATCH] Partially apply https://github.com/mangoszero/server/commit/f81e455e3a68012ce7e7e9c78100e7907fab8672 --- src/game/Object/Creature.cpp | 5 ++--- src/game/Object/GameObject.cpp | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/game/Object/Creature.cpp b/src/game/Object/Creature.cpp index 588932876..29aef85fb 100644 --- a/src/game/Object/Creature.cpp +++ b/src/game/Object/Creature.cpp @@ -196,8 +196,7 @@ Creature::~Creature() void Creature::AddToWorld() { #ifdef ENABLE_ELUNA - if (!IsInWorld()) - sEluna->OnAddToWorld(this); + bool inWorld = IsInWorld(); #endif /* ENABLE_ELUNA */ ///- Register the creature for guid lookup @@ -211,7 +210,7 @@ void Creature::AddToWorld() SetActiveObjectState(true); #ifdef ENABLE_ELUNA - if (!IsInWorld()) + if (!inWorld) sEluna->OnAddToWorld(this); #endif /* ENABLE_ELUNA */ } diff --git a/src/game/Object/GameObject.cpp b/src/game/Object/GameObject.cpp index 0c9fb02ab..42a022f93 100644 --- a/src/game/Object/GameObject.cpp +++ b/src/game/Object/GameObject.cpp @@ -93,8 +93,7 @@ GameObject::~GameObject() void GameObject::AddToWorld() { #ifdef ENABLE_ELUNA - if (!IsInWorld()) - sEluna->OnAddToWorld(this); + bool inWorld = IsInWorld(); #endif /* ENABLE_ELUNA */ ///- Register the gameobject for guid lookup @@ -110,7 +109,7 @@ void GameObject::AddToWorld() UpdateCollisionState(); #ifdef ENABLE_ELUNA - if (!IsInWorld()) + if (!inWorld) sEluna->OnAddToWorld(this); #endif /* ENABLE_ELUNA */ }