mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 09:39:11 +00:00
revert(Core): ChrRace.dbc full implementation (#16114)
* revert (core): ChrRace.dbc full implementation we revert this due to several issues arrising. Although the dbc reading is done in full and correctly. Azerothcore relied on the original handling (althought not propper) for so long that there is * revert * Update remove_charrace_dbc.sql * Update remove_charrace_dbc.sql * Update remove_charrace_dbc.sql
This commit is contained in:
@@ -9974,15 +9974,9 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au
|
||||
return true;
|
||||
}
|
||||
|
||||
void Unit::setPowerType(Powers new_powertype, bool sendUpdate/* = true*/)
|
||||
void Unit::setPowerType(Powers new_powertype)
|
||||
{
|
||||
if (getPowerType() == new_powertype)
|
||||
return;
|
||||
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_POWER_TYPE, new_powertype);
|
||||
|
||||
if (!sendUpdate)
|
||||
return;
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, 3, new_powertype);
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
@@ -15185,10 +15179,7 @@ uint32 Unit::GetCreatureType() const
|
||||
if (ssEntry && ssEntry->creatureType > 0)
|
||||
return ssEntry->creatureType;
|
||||
else
|
||||
{
|
||||
ChrRacesEntry const* raceEntry = sChrRacesStore.AssertEntry(getRace());
|
||||
return raceEntry->CreatureType;
|
||||
}
|
||||
return CREATURE_TYPE_HUMANOID;
|
||||
}
|
||||
else
|
||||
return ToCreature()->GetCreatureTemplate()->type;
|
||||
@@ -21292,6 +21283,25 @@ void Unit::BuildCooldownPacket(WorldPacket& data, uint8 flags, PacketCooldowns c
|
||||
}
|
||||
}
|
||||
|
||||
uint8 Unit::getRace(bool original) const
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
// Check if unit in combat with specific unit
|
||||
bool Unit::IsInCombatWith(Unit const* who) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user