aboutsummaryrefslogtreecommitdiff
path: root/src/game/GameObject.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-07-10 16:29:43 +0200
committerQAston <none@none>2009-07-10 16:29:43 +0200
commit6af0b55dd77e29ead2f9e446e652a04a456f4066 (patch)
tree6d814ba15cca42643f4821c9ae7b3cbb909cee35 /src/game/GameObject.cpp
parent83f74b5e469b14171d1ec8618f8dac512ff8452f (diff)
*Fix compile - sorry for that:/.
--HG-- branch : trunk
Diffstat (limited to 'src/game/GameObject.cpp')
-rw-r--r--src/game/GameObject.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index b690dbccddb..9afe4aa35f7 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -921,6 +921,20 @@ void GameObject::SetGoArtKit(uint8 kit)
data->ArtKit = kit;
}
+void GameObject::SetOwnerGUID(uint64 owner)
+{
+ // Owner already found and different than expected owner - remove object from old owner
+ if (owner && GetOwnerGUID() && GetOwnerGUID() != owner)
+ {
+ if (Unit* owner = GetOwner())
+ owner->RemoveGameObject(this, false);
+ else
+ assert(false);
+ }
+ m_spawnedByDefault = false; // all object with owner is despawned after delay
+ SetUInt64Value(OBJECT_FIELD_CREATED_BY, owner);
+}
+
void GameObject::SwitchDoorOrButton(bool activate, bool alternative /* = false */)
{
if(activate)