Some build errors and warning fixed

Fixed:
22 errors
19 warnings

82 errors and 7 warnings remaining, at this point.
This commit is contained in:
Charles A Edwards 2016-01-30 10:10:37 +00:00 committed by Antz
parent f2f3445a7c
commit 923d3f5788
3 changed files with 30 additions and 5 deletions

View file

@ -80,6 +80,9 @@ class Map;
class UpdateMask;
class InstanceData;
class TerrainInfo;
#ifdef ENABLE_ELUNA
class ElunaEventProcessor;
#endif /* ENABLE_ELUNA */
class TransportInfo;
typedef UNORDERED_MAP<Player*, UpdateData> UpdateDataMapType;
@ -221,6 +224,24 @@ class Object
ObjectGuid const& GetGuidValue(uint16 index) const { return *reinterpret_cast<ObjectGuid const*>(&GetUInt64Value(index)); }
Player* ToPlayer() { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Player*>(this); else return NULL; }
Player const* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Player const*>(this); else return NULL; }
Creature* ToCreature() { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast<Creature*>(this); else return NULL; }
Creature const* ToCreature() const { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast<Creature const*>(this); else return NULL; }
Unit* ToUnit() { if (isType(TYPEMASK_UNIT)) return reinterpret_cast<Unit*>(this); else return NULL; }
Unit const* ToUnit() const { if (isType(TYPEMASK_UNIT)) return reinterpret_cast<Unit const*>(this); else return NULL; }
GameObject* ToGameObject() { if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast<GameObject*>(this); else return NULL; }
GameObject const* ToGameObject() const { if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast<GameObject const*>(this); else return NULL; }
Corpse* ToCorpse() { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast<Corpse*>(this); else return NULL; }
Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast<Corpse const*>(this); else return NULL; }
DynamicObject* ToDynObject() { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast<DynamicObject*>(this); else return NULL; }
DynamicObject const* ToDynObject() const { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast<DynamicObject const*>(this); else return NULL; }
void SetInt32Value(uint16 index, int32 value);
void SetUInt32Value(uint16 index, uint32 value);
void SetUInt64Value(uint16 index, const uint64& value);
@ -624,6 +645,10 @@ class WorldObject : public Object
virtual void StartGroupLoot(Group* /*group*/, uint32 /*timer*/) {}
#ifdef ENABLE_ELUNA
ElunaEventProcessor* elunaEvents;
#endif /* ENABLE_ELUNA */
protected:
explicit WorldObject();