Core/Player: Implement original race variable at unit level and initialize it (for future customizations)

This commit is contained in:
mik1893
2016-08-13 15:50:32 +01:00
committed by Yehonal
parent c4f49d6ab3
commit b689b7f1e1
3 changed files with 31 additions and 17 deletions

View File

@@ -1457,8 +1457,8 @@ class Unit : public WorldObject
uint8 getLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); }
uint8 getLevelForTarget(WorldObject const* /*target*/) const { return getLevel(); }
void SetLevel(uint8 lvl, bool showLevelChange = true);
uint8 getRace() const { return GetByteValue(UNIT_FIELD_BYTES_0, 0); }
uint32 getRaceMask() const { return 1 << (getRace()-1); }
uint8 getRace(bool original = false) const;
uint32 getRaceMask() const { return 1 << (getRace(true)-1); }
uint8 getClass() const { return GetByteValue(UNIT_FIELD_BYTES_0, 1); }
uint32 getClassMask() const { return 1 << (getClass()-1); }
uint8 getGender() const { return GetByteValue(UNIT_FIELD_BYTES_0, 2); }
@@ -2440,6 +2440,8 @@ class Unit : public WorldObject
void _UpdateAutoRepeatSpell();
uint8 m_realRace;
bool m_AutoRepeatFirstCast;
int32 m_attackTimer[MAX_ATTACK];