Core/Unit: enable setting and retrieval of a temporary race for players

This commit is contained in:
mik1893
2016-08-14 08:22:17 +01:00
committed by Yehonal
parent fb2ac1a6a7
commit f4382e25c0
2 changed files with 32 additions and 4 deletions

View File

@@ -151,7 +151,7 @@ m_movedByPlayer(NULL), m_lastSanctuaryTime(0), IsAIEnabled(false), NeedChangeAI(
m_ControlledByPlayer(false), m_CreatedByPlayer(false), movespline(new Movement::MoveSpline()), i_AI(NULL),
i_disabledAI(NULL), m_procDeep(0), m_removedAurasCount(0), i_motionMaster(new MotionMaster(this)), m_regenTimer(0),
m_ThreatManager(this), m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE),
m_HostileRefManager(this), m_AutoRepeatFirstCast(false), m_realRace(0)
m_HostileRefManager(this), m_AutoRepeatFirstCast(false), m_realRace(0), m_race(0)
{
#ifdef _MSC_VER
#pragma warning(default:4355)
@@ -17857,6 +17857,21 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType)
}
break;
}
default: // One standard for other races.
{
switch (totemType)
{
case SUMMON_TYPE_TOTEM_FIRE: // fire
return 4589;
case SUMMON_TYPE_TOTEM_EARTH: // earth
return 4588;
case SUMMON_TYPE_TOTEM_WATER: // water
return 4587;
case SUMMON_TYPE_TOTEM_AIR: // air
return 4590;
}
break;
}
}
return 0;
}
@@ -19264,8 +19279,19 @@ void Unit::BuildCooldownPacket(WorldPacket& data, uint8 flags, PacketCooldowns c
uint8 Unit::getRace(bool original) const
{
if (GetTypeId() == TYPEID_PLAYER && original)
return m_realRace;
if (GetTypeId() == TYPEID_PLAYER)
{
if (original)
return m_realRace;
else
return m_race;
}
return GetByteValue(UNIT_FIELD_BYTES_0, 0);
}
void Unit::setRace(uint8 race)
{
if (GetTypeId() == TYPEID_PLAYER)
m_race = race;
}