aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-06-03 19:53:28 +0200
committerDDuarte <dnpd.dd@gmail.com>2015-06-26 00:53:12 +0100
commit5fe819462f30d6564f592e628c0828efd73689ef (patch)
tree4150d9feb0b6fa097a9b13c5bfb29a3c1ef57d1b /src
parenta8d8976e2cf8e9254fb1f5bdc873d823a0d634d1 (diff)
Core/GameObject: Removed unneeded argument from GameObjectModel::Relocate and renamed it to UpdatePosition
(cherry picked from commit 6e9ab38fcc9d2859393e452ef8630ee420783e47)
Diffstat (limited to 'src')
-rw-r--r--src/server/collision/Models/GameObjectModel.cpp10
-rw-r--r--src/server/collision/Models/GameObjectModel.h2
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp
index 0355d2e848c..dd1502c45b0 100644
--- a/src/server/collision/Models/GameObjectModel.cpp
+++ b/src/server/collision/Models/GameObjectModel.cpp
@@ -186,12 +186,12 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto
return hit;
}
-bool GameObjectModel::Relocate(const GameObject& go)
+bool GameObjectModel::UpdatePosition()
{
if (!iModel)
return false;
- ModelList::const_iterator it = model_list.find(go.GetDisplayId());
+ ModelList::const_iterator it = model_list.find(owner->GetDisplayId());
if (it == model_list.end())
return false;
@@ -203,9 +203,9 @@ bool GameObjectModel::Relocate(const GameObject& go)
return false;
}
- iPos = Vector3(go.GetPositionX(), go.GetPositionY(), go.GetPositionZ());
+ iPos = Vector3(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ());
- G3D::Matrix3 iRotation = G3D::Matrix3::fromEulerAnglesZYX(go.GetOrientation(), 0, 0);
+ G3D::Matrix3 iRotation = G3D::Matrix3::fromEulerAnglesZYX(owner->GetOrientation(), 0, 0);
iInvRot = iRotation.inverse();
// transform bounding box:
mdl_box = AABox(mdl_box.low() * iScale, mdl_box.high() * iScale);
@@ -219,7 +219,7 @@ bool GameObjectModel::Relocate(const GameObject& go)
for (int i = 0; i < 8; ++i)
{
Vector3 pos(iBound.corner(i));
- go.SummonCreature(1, pos.x, pos.y, pos.z, 0, TEMPSUMMON_MANUAL_DESPAWN);
+ owner->SummonCreature(1, pos.x, pos.y, pos.z, 0, TEMPSUMMON_MANUAL_DESPAWN);
}
#endif
diff --git a/src/server/collision/Models/GameObjectModel.h b/src/server/collision/Models/GameObjectModel.h
index 232ebbee5e9..43d299d6d8f 100644
--- a/src/server/collision/Models/GameObjectModel.h
+++ b/src/server/collision/Models/GameObjectModel.h
@@ -68,7 +68,7 @@ public:
static GameObjectModel* Create(const GameObject& go);
- bool Relocate(GameObject const& go);
+ bool UpdatePosition();
};
#endif // _GAMEOBJECT_MODEL_H
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 9dfa603dd7c..50981a163be 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -2317,7 +2317,7 @@ void GameObject::UpdateModelPosition()
if (GetMap()->ContainsGameObjectModel(*m_model))
{
GetMap()->RemoveGameObjectModel(*m_model);
- m_model->Relocate(*this);
+ m_model->UpdatePosition();
GetMap()->InsertGameObjectModel(*m_model);
}
}