mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
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:
parent
f2f3445a7c
commit
923d3f5788
3 changed files with 30 additions and 5 deletions
|
|
@ -80,6 +80,9 @@ class Map;
|
||||||
class UpdateMask;
|
class UpdateMask;
|
||||||
class InstanceData;
|
class InstanceData;
|
||||||
class TerrainInfo;
|
class TerrainInfo;
|
||||||
|
#ifdef ENABLE_ELUNA
|
||||||
|
class ElunaEventProcessor;
|
||||||
|
#endif /* ENABLE_ELUNA */
|
||||||
class TransportInfo;
|
class TransportInfo;
|
||||||
|
|
||||||
typedef UNORDERED_MAP<Player*, UpdateData> UpdateDataMapType;
|
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)); }
|
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 SetInt32Value(uint16 index, int32 value);
|
||||||
void SetUInt32Value(uint16 index, uint32 value);
|
void SetUInt32Value(uint16 index, uint32 value);
|
||||||
void SetUInt64Value(uint16 index, const uint64& value);
|
void SetUInt64Value(uint16 index, const uint64& value);
|
||||||
|
|
@ -624,6 +645,10 @@ class WorldObject : public Object
|
||||||
|
|
||||||
virtual void StartGroupLoot(Group* /*group*/, uint32 /*timer*/) {}
|
virtual void StartGroupLoot(Group* /*group*/, uint32 /*timer*/) {}
|
||||||
|
|
||||||
|
#ifdef ENABLE_ELUNA
|
||||||
|
ElunaEventProcessor* elunaEvents;
|
||||||
|
#endif /* ENABLE_ELUNA */
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit WorldObject();
|
explicit WorldObject();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10087,7 +10087,7 @@ Powers Unit::GetPowerTypeByIndex(uint32 index, uint32 classId)
|
||||||
return Powers(sChrClassXPowerIndexStore[classId][index]);
|
return Powers(sChrClassXPowerIndexStore[classId][index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 Unit::GetPower(Powers power) const
|
uint32 Unit::GetPower(Powers power) const
|
||||||
{
|
{
|
||||||
if (power == POWER_HEALTH)
|
if (power == POWER_HEALTH)
|
||||||
return GetHealth();
|
return GetHealth();
|
||||||
|
|
@ -10099,7 +10099,7 @@ int32 Unit::GetPower(Powers power) const
|
||||||
return GetUInt32Value(UNIT_FIELD_POWER1 + powerIndex);
|
return GetUInt32Value(UNIT_FIELD_POWER1 + powerIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 Unit::GetPowerByIndex(uint32 index) const
|
uint32 Unit::GetPowerByIndex(uint32 index) const
|
||||||
{
|
{
|
||||||
MANGOS_ASSERT(index < MAX_STORED_POWERS);
|
MANGOS_ASSERT(index < MAX_STORED_POWERS);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/**
|
/**Unit::GetPower
|
||||||
* MaNGOS is a full featured server for World of Warcraft, supporting
|
* MaNGOS is a full featured server for World of Warcraft, supporting
|
||||||
* the following clients: 1.12.x, 2.4.3, 3.3.5a, 4.3.4a and 5.4.8
|
* the following clients: 1.12.x, 2.4.3, 3.3.5a, 4.3.4a and 5.4.8
|
||||||
*
|
*
|
||||||
|
|
@ -1721,8 +1721,8 @@ class Unit : public WorldObject
|
||||||
*/
|
*/
|
||||||
Powers GetPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, 3)); }
|
Powers GetPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, 3)); }
|
||||||
void setPowerType(Powers power);
|
void setPowerType(Powers power);
|
||||||
int32 GetPower(Powers power) const;
|
uint32 GetPower(Powers power) const;
|
||||||
int32 GetPowerByIndex(uint32 index) const;
|
uint32 GetPowerByIndex(uint32 index) const;
|
||||||
uint32 GetMaxPower(Powers power) const;
|
uint32 GetMaxPower(Powers power) const;
|
||||||
uint32 GetMaxPowerByIndex(uint32 index) const;
|
uint32 GetMaxPowerByIndex(uint32 index) const;
|
||||||
void SetPowerByIndex(uint32 power, int32 val);
|
void SetPowerByIndex(uint32 power, int32 val);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue