aboutsummaryrefslogtreecommitdiff
path: root/src/game/GameObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/GameObject.h')
-rw-r--r--src/game/GameObject.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/game/GameObject.h b/src/game/GameObject.h
index 8e2a37fe55e..43441e2fb9c 100644
--- a/src/game/GameObject.h
+++ b/src/game/GameObject.h
@@ -611,6 +611,11 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject
void SetOwnerGUID(uint64 owner)
{
+ // Owner already found and different than expected owner - remove object from old owner
+ if (owner && GetOwnerGUID() && GetOwnerGUID() != owner)
+ {
+ assert(false);
+ }
m_spawnedByDefault = false; // all object with owner is despawned after delay
SetUInt64Value(OBJECT_FIELD_CREATED_BY, owner);
}