mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[10782] Use Team enum types in all appropriate cases and catches bug in result fix.
* Fixed wrong arenaid use at leave arena queue. * Fixed memory lost and etc at not virtual EndBattleground call * Fixed crash at arena join with fake data from client. * Code cleanups.
This commit is contained in:
parent
c2331f58bc
commit
cc0655a402
38 changed files with 315 additions and 321 deletions
|
|
@ -196,7 +196,7 @@ void Creature::RemoveCorpse()
|
|||
/**
|
||||
* change the entry of creature until respawn
|
||||
*/
|
||||
bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
|
||||
bool Creature::InitEntry(uint32 Entry, const CreatureData *data )
|
||||
{
|
||||
CreatureInfo const *normalInfo = ObjectMgr::GetCreatureTemplate(Entry);
|
||||
if(!normalInfo)
|
||||
|
|
@ -294,9 +294,9 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data, bool preserveHPAndPower)
|
||||
bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData *data, bool preserveHPAndPower)
|
||||
{
|
||||
if (!InitEntry(Entry, team, data))
|
||||
if (!InitEntry(Entry, data))
|
||||
return false;
|
||||
|
||||
m_regenHealth = GetCreatureInfo()->RegenHealth;
|
||||
|
|
@ -682,7 +682,7 @@ bool Creature::AIM_Initialize()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, const CreatureData *data)
|
||||
bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, Team team, const CreatureData *data)
|
||||
{
|
||||
MANGOS_ASSERT(map);
|
||||
SetMap(map);
|
||||
|
|
@ -1180,7 +1180,7 @@ float Creature::GetSpellDamageMod(int32 Rank)
|
|||
}
|
||||
}
|
||||
|
||||
bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 team, const CreatureData *data)
|
||||
bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, Team team, const CreatureData *data)
|
||||
{
|
||||
CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry);
|
||||
if(!cinfo)
|
||||
|
|
@ -1221,8 +1221,7 @@ bool Creature::LoadFromDB(uint32 guidlow, Map *map)
|
|||
else
|
||||
guidlow = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT);
|
||||
|
||||
uint16 team = 0;
|
||||
if (!Create(guidlow, map, data->phaseMask, data->id, team, data))
|
||||
if (!Create(guidlow, map, data->phaseMask, data->id, TEAM_NONE, data))
|
||||
return false;
|
||||
|
||||
Relocate(data->posX, data->posY, data->posZ, data->orientation);
|
||||
|
|
@ -1924,7 +1923,7 @@ bool Creature::LoadCreatureAddon(bool reload)
|
|||
/// Send a message to LocalDefense channel for players opposition team in the zone
|
||||
void Creature::SendZoneUnderAttackMessage(Player* attacker)
|
||||
{
|
||||
uint32 enemy_team = attacker->GetTeam();
|
||||
Team enemy_team = attacker->GetTeam();
|
||||
|
||||
WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4);
|
||||
data << uint32(GetZoneId());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue