From 9bd797d402c498d2e8f70aa916b3caf3956577af Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Fri, 27 Nov 2009 01:41:26 +0100 Subject: Apply #412. Add support to gameobject type Transport (11) that should stop like Orgrimmar arena Elevators or pilars. Patch by Spp and Opterman --HG-- branch : trunk --- src/game/GameObject.cpp | 15 +++++++++++++++ src/game/GameObject.h | 1 + src/game/Object.cpp | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 00299792a5a..a005e5ddee1 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -194,6 +194,11 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING: m_goValue->building.health = goinfo->building.intactNumHits + goinfo->building.damagedNumHits; break; + case GAMEOBJECT_TYPE_TRANSPORT: + SetUInt32Value(GAMEOBJECT_LEVEL, goinfo->transport.pause); + if (goinfo->transport.startOpen) + SetGoState(GO_STATE_ACTIVE); + break; } SetZoneScript(); @@ -713,6 +718,16 @@ bool GameObject::IsTransport() const return gInfo->type == GAMEOBJECT_TYPE_TRANSPORT || gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT; } +// is Dynamic transport = non-stop Transport +bool GameObject::IsDynTransport() const +{ + // If something is marked as a transport, don't transmit an out of range packet for it. + GameObjectInfo const * gInfo = GetGOInfo(); + if(!gInfo) return false; + return gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT || (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT && !gInfo->transport.pause); +} + + Unit* GameObject::GetOwner(bool inWorld) const { if (inWorld) diff --git a/src/game/GameObject.h b/src/game/GameObject.h index c65938000bb..a915b81fc78 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -590,6 +590,7 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject GameObjectValue * GetGOValue() const { return m_goValue; } bool IsTransport() const; + bool IsDynTransport() const; uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; } diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 68f7d08be68..cb459aca43a 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -481,7 +481,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask bool IsActivateToQuest = false; if (updatetype == UPDATETYPE_CREATE_OBJECT || updatetype == UPDATETYPE_CREATE_OBJECT2) { - if (isType(TYPEMASK_GAMEOBJECT) && !((GameObject*)this)->IsTransport()) + if (isType(TYPEMASK_GAMEOBJECT) && !((GameObject*)this)->IsDynTransport()) { if ( ((GameObject*)this)->ActivateToQuest(target) || target->isGameMaster()) IsActivateToQuest = true; -- cgit v1.2.3