diff options
| author | Spp <spp@jorge.gr> | 2011-12-27 10:05:49 +0100 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2011-12-27 10:15:27 +0100 |
| commit | fa9daaf95b9f09f3a442087cbc59abc782814c63 (patch) | |
| tree | c24fe99837993c101de77df1416fde629c993817 /src/server/game/Entities/Creature | |
| parent | 8323027e0c15e97e5da5ec0948c447273321d43f (diff) | |
| parent | 317628902462c371dc29ec984803fbfb6412402c (diff) | |
Merge branch 'master' into 4.x and some warning fixes
Diffstat (limited to 'src/server/game/Entities/Creature')
4 files changed, 14 insertions, 10 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 8065e66216e..1c88e19406f 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -137,7 +137,7 @@ bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) return true; } -Creature::Creature(): Unit(), MapCreature(), +Creature::Creature(bool isWorldObject): Unit(isWorldObject), MapCreature(), lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), lootingGroupLowGUID(0), m_PlayerDamageReq(0), m_lootMoney(0), m_lootRecipient(0), m_lootRecipientGroup(0), m_corpseRemoveTime(0), m_respawnTime(0), m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE), @@ -160,6 +160,7 @@ m_creatureInfo(NULL), m_creatureData(NULL), m_formation(NULL) ResetLootMode(); // restore default loot mode TriggerJustRespawned = false; + m_isTempWorldObject = false; } Creature::~Creature() diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index ae1c3ac59c6..6abeebbed50 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -442,7 +442,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature { public: - explicit Creature(); + explicit Creature(bool isWorldObject = false); virtual ~Creature(); void AddToWorld(); @@ -709,6 +709,9 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature uint32 GetGUIDTransport() { return guid_transport; } void FarTeleportTo(Map* map, float X, float Y, float Z, float O); + + bool m_isTempWorldObject; //true when possessed + protected: bool CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint32 team, const CreatureData* data = NULL); bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL); diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index b17606b83cc..1b06f0f0b6a 100755 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -22,8 +22,8 @@ #include "ObjectMgr.h" #include "TemporarySummon.h" -TempSummon::TempSummon(SummonPropertiesEntry const* properties, Unit* owner) : -Creature(), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN), +TempSummon::TempSummon(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject) : +Creature(isWorldObject), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN), m_timer(0), m_lifetime(0) { m_summonerGUID = owner ? owner->GetGUID() : 0; @@ -272,7 +272,7 @@ void TempSummon::RemoveFromWorld() Creature::RemoveFromWorld(); } -Minion::Minion(SummonPropertiesEntry const* properties, Unit* owner) : TempSummon(properties, owner) +Minion::Minion(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject) : TempSummon(properties, owner, isWorldObject) , m_owner(owner) { ASSERT(m_owner); @@ -306,7 +306,7 @@ bool Minion::IsGuardianPet() const return isPet() || (m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET); } -Guardian::Guardian(SummonPropertiesEntry const* properties, Unit* owner) : Minion(properties, owner) +Guardian::Guardian(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject) : Minion(properties, owner, isWorldObject) , m_bonusSpellDamage(0) { memset(m_statFromOwner, 0, sizeof(float)*MAX_STATS); @@ -340,7 +340,7 @@ void Guardian::InitSummon() m_owner->ToPlayer()->CharmSpellInitialize(); } -Puppet::Puppet(SummonPropertiesEntry const* properties, Unit* owner) : Minion(properties, owner) +Puppet::Puppet(SummonPropertiesEntry const* properties, Unit* owner) : Minion(properties, owner, false) //maybe true? { ASSERT(owner->GetTypeId() == TYPEID_PLAYER); m_owner = (Player*)owner; diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h index 1982dec4bb8..69ae8349155 100755 --- a/src/server/game/Entities/Creature/TemporarySummon.h +++ b/src/server/game/Entities/Creature/TemporarySummon.h @@ -24,7 +24,7 @@ class TempSummon : public Creature { public: - explicit TempSummon(SummonPropertiesEntry const* properties, Unit* owner); + explicit TempSummon(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject); virtual ~TempSummon() {} void Update(uint32 time); virtual void InitStats(uint32 lifetime); @@ -48,7 +48,7 @@ class TempSummon : public Creature class Minion : public TempSummon { public: - Minion(SummonPropertiesEntry const* properties, Unit* owner); + Minion(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject); void InitStats(uint32 duration); void RemoveFromWorld(); Unit* GetOwner() { return m_owner; } @@ -64,7 +64,7 @@ class Minion : public TempSummon class Guardian : public Minion { public: - Guardian(SummonPropertiesEntry const* properties, Unit* owner); + Guardian(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject); void InitStats(uint32 duration); bool InitStatsForLevel(uint8 level); void InitSummon(); |
