Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-12-23 23:25:44 +01:00
parent 95daf7998f
commit 928443d899
245 changed files with 5711 additions and 5714 deletions
+6 -6
View File
@@ -52,7 +52,7 @@ void Corpse::AddToWorld()
{
///- Register the corpse for guid lookup
if (!IsInWorld())
sObjectAccessor.AddObject(this);
sObjectAccessor->AddObject(this);
Object::AddToWorld();
}
@@ -61,7 +61,7 @@ void Corpse::RemoveFromWorld()
{
///- Remove the corpse from the accessor
if (IsInWorld())
sObjectAccessor.RemoveObject(this);
sObjectAccessor->RemoveObject(this);
Object::RemoveFromWorld();
}
@@ -81,7 +81,7 @@ bool Corpse::Create(uint32 guidlow, Player *owner)
if (!IsPositionValid())
{
sLog.outError("Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
sLog->outError("Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
guidlow, owner->GetName(), owner->GetPositionX(), owner->GetPositionY());
return false;
}
@@ -140,7 +140,7 @@ void Corpse::DeleteBonesFromWorld()
if (!corpse)
{
sLog.outError("Bones %u not found in world.", GetGUIDLow());
sLog->outError("Bones %u not found in world.", GetGUIDLow());
return;
}
@@ -183,7 +183,7 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields)
if (m_type >= MAX_CORPSE_TYPE)
{
sLog.outError("Corpse (guidlow %d, owner %d) have wrong corpse type, not load.",GetGUIDLow(),GUID_LOPART(GetOwnerGUID()));
sLog->outError("Corpse (guidlow %d, owner %d) have wrong corpse type, not load.",GetGUIDLow(),GUID_LOPART(GetOwnerGUID()));
return false;
}
@@ -201,7 +201,7 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields)
if (!IsPositionValid())
{
sLog.outError("Corpse (guidlow %d, owner %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
sLog->outError("Corpse (guidlow %d, owner %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
GetGUIDLow(), GUID_LOPART(GetOwnerGUID()), GetPositionX(), GetPositionY());
return false;
}
+69 -69
View File
@@ -158,7 +158,7 @@ m_formation(NULL)
DisableReputationGain = false;
//m_unit_movement_flags = MONSTER_MOVE_WALK;
m_SightDistance = sWorld.getFloatConfig(CONFIG_SIGHT_MONSTER);
m_SightDistance = sWorld->getFloatConfig(CONFIG_SIGHT_MONSTER);
m_CombatDistance = 0;//MELEE_RANGE;
ResetLootMode(); // restore default loot mode
@@ -173,7 +173,7 @@ Creature::~Creature()
i_AI = NULL;
//if (m_uint32Values)
// sLog.outError("Deconstruct Creature Entry = %u", GetEntry());
// sLog->outError("Deconstruct Creature Entry = %u", GetEntry());
}
void Creature::AddToWorld()
@@ -183,7 +183,7 @@ void Creature::AddToWorld()
{
if (m_zoneScript)
m_zoneScript->OnCreatureCreate(this);
sObjectAccessor.AddObject(this);
sObjectAccessor->AddObject(this);
Unit::AddToWorld();
SearchFormation();
AIM_Initialize();
@@ -199,9 +199,9 @@ void Creature::RemoveFromWorld()
if (m_zoneScript)
m_zoneScript->OnCreatureRemove(this);
if (m_formation)
formation_mgr.RemoveCreatureFromGroup(m_formation, this);
sFormationMgr->RemoveCreatureFromGroup(m_formation, this);
Unit::RemoveFromWorld();
sObjectAccessor.RemoveObject(this);
sObjectAccessor->RemoveObject(this);
}
}
@@ -226,7 +226,7 @@ void Creature::SearchFormation()
CreatureGroupInfoType::iterator frmdata = CreatureGroupMap.find(lowguid);
if (frmdata != CreatureGroupMap.end())
formation_mgr.AddCreatureToGroup(frmdata->second->leaderGUID, this);
sFormationMgr->AddCreatureToGroup(frmdata->second->leaderGUID, this);
}
void Creature::RemoveCorpse(bool setSpawnTime)
@@ -260,7 +260,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
CreatureInfo const *normalInfo = ObjectMgr::GetCreatureTemplate(Entry);
if (!normalInfo)
{
sLog.outErrorDb("Creature::InitEntry creature entry %u does not exist.", Entry);
sLog->outErrorDb("Creature::InitEntry creature entry %u does not exist.", Entry);
return false;
}
@@ -279,7 +279,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
if (!cinfo)
{
// maybe check such things already at startup
sLog.outErrorDb("Creature::UpdateEntry creature difficulty %u entry %u does not exist.", diff + 1, actualEntry);
sLog->outErrorDb("Creature::UpdateEntry creature difficulty %u entry %u does not exist.", diff + 1, actualEntry);
return false;
}
}
@@ -298,7 +298,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
// Cancel load if no model defined
if (!(cinfo->GetFirstValidModelId()))
{
sLog.outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry);
sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry);
return false;
}
@@ -306,7 +306,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(display_id);
if (!minfo) // Cancel load if no model defined
{
sLog.outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry);
sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry);
return false;
}
@@ -449,11 +449,11 @@ void Creature::Update(uint32 diff)
{
case JUST_ALIVED:
// Don't must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting.
sLog.outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry());
sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry());
break;
case JUST_DIED:
// Don't must be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting.
sLog.outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)",GetGUIDLow(),GetEntry());
sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)",GetGUIDLow(),GetEntry());
break;
case DEAD:
{
@@ -500,7 +500,7 @@ void Creature::Update(uint32 diff)
else if (m_corpseRemoveTime <= time(NULL))
{
RemoveCorpse(false);
sLog.outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
sLog->outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
}
else
{
@@ -517,7 +517,7 @@ void Creature::Update(uint32 diff)
if (m_corpseRemoveTime <= time(NULL))
{
RemoveCorpse(false);
sLog.outStaticDebug("Removing alive corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
sLog->outStaticDebug("Removing alive corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
}
}
@@ -611,7 +611,7 @@ void Creature::RegenerateMana()
{
if (!IsUnderLastManaUseEffect())
{
float ManaIncreaseRate = sWorld.getRate(RATE_POWER_MANA);
float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA);
float Spirit = GetStat(STAT_SPIRIT);
addvalue = uint32((Spirit / 5.0f + 17.0f) * ManaIncreaseRate);
@@ -647,7 +647,7 @@ void Creature::RegenerateHealth()
// Not only pet, but any controlled creature
if (GetCharmerOrOwnerGUID())
{
float HealthIncreaseRate = sWorld.getRate(RATE_HEALTH);
float HealthIncreaseRate = sWorld->getRate(RATE_HEALTH);
float Spirit = GetStat(STAT_SPIRIT);
if (GetPower(POWER_MANA) > 0)
@@ -676,7 +676,7 @@ void Creature::DoFleeToGetAssistance()
if (HasAuraType(SPELL_AURA_PREVENTS_FLEEING))
return;
float radius = sWorld.getFloatConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
if (radius >0)
{
Creature* pCreature = NULL;
@@ -696,7 +696,7 @@ void Creature::DoFleeToGetAssistance()
UpdateSpeed(MOVE_RUN, false);
if (!pCreature)
//SetFeared(true, getVictim()->GetGUID(), 0 ,sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
//SetFeared(true, getVictim()->GetGUID(), 0 ,sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
//TODO: use 31365
SetControlled(true, UNIT_STAT_FLEEING);
else
@@ -709,7 +709,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
// make sure nothing can change the AI during AI update
if (m_AI_locked)
{
sLog.outDebug("AIM_Initialize: failed to init, locked.");
sLog->outDebug("AIM_Initialize: failed to init, locked.");
return false;
}
@@ -748,7 +748,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry);
if (!cinfo)
{
sLog.outErrorDb("Creature entry %u does not exist.", Entry);
sLog->outErrorDb("Creature entry %u does not exist.", Entry);
return false;
}
@@ -756,7 +756,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
if (!IsPositionValid())
{
sLog.outError("Creature (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,Entry,x,y);
sLog->outError("Creature (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,Entry,x,y);
return false;
}
@@ -768,19 +768,19 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
switch (GetCreatureInfo()->rank)
{
case CREATURE_ELITE_RARE:
m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_RARE);
m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RARE);
break;
case CREATURE_ELITE_ELITE:
m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_ELITE);
m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_ELITE);
break;
case CREATURE_ELITE_RAREELITE:
m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_RAREELITE);
m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RAREELITE);
break;
case CREATURE_ELITE_WORLDBOSS:
m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_WORLDBOSS);
m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_WORLDBOSS);
break;
default:
m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_NORMAL);
m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_NORMAL);
break;
}
LoadCreaturesAddon();
@@ -836,7 +836,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS)
{
sLog.outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.",
sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.",
GetGUIDLow(),GetEntry());
return false;
}
@@ -1037,7 +1037,7 @@ void Creature::SaveToDB()
CreatureData const *data = sObjectMgr->GetCreatureData(m_DBTableGuid);
if (!data)
{
sLog.outError("Creature::SaveToDB failed, cannot get creature data!");
sLog->outError("Creature::SaveToDB failed, cannot get creature data!");
return;
}
@@ -1186,17 +1186,17 @@ float Creature::_GetHealthMod(int32 Rank)
switch (Rank) // define rates for each elite rank
{
case CREATURE_ELITE_NORMAL:
return sWorld.getRate(RATE_CREATURE_NORMAL_HP);
return sWorld->getRate(RATE_CREATURE_NORMAL_HP);
case CREATURE_ELITE_ELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_HP);
return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_HP);
case CREATURE_ELITE_RAREELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_RAREELITE_HP);
return sWorld->getRate(RATE_CREATURE_ELITE_RAREELITE_HP);
case CREATURE_ELITE_WORLDBOSS:
return sWorld.getRate(RATE_CREATURE_ELITE_WORLDBOSS_HP);
return sWorld->getRate(RATE_CREATURE_ELITE_WORLDBOSS_HP);
case CREATURE_ELITE_RARE:
return sWorld.getRate(RATE_CREATURE_ELITE_RARE_HP);
return sWorld->getRate(RATE_CREATURE_ELITE_RARE_HP);
default:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_HP);
return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_HP);
}
}
@@ -1205,17 +1205,17 @@ float Creature::_GetDamageMod(int32 Rank)
switch (Rank) // define rates for each elite rank
{
case CREATURE_ELITE_NORMAL:
return sWorld.getRate(RATE_CREATURE_NORMAL_DAMAGE);
return sWorld->getRate(RATE_CREATURE_NORMAL_DAMAGE);
case CREATURE_ELITE_ELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE);
return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE);
case CREATURE_ELITE_RAREELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_RAREELITE_DAMAGE);
return sWorld->getRate(RATE_CREATURE_ELITE_RAREELITE_DAMAGE);
case CREATURE_ELITE_WORLDBOSS:
return sWorld.getRate(RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE);
return sWorld->getRate(RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE);
case CREATURE_ELITE_RARE:
return sWorld.getRate(RATE_CREATURE_ELITE_RARE_DAMAGE);
return sWorld->getRate(RATE_CREATURE_ELITE_RARE_DAMAGE);
default:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE);
return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE);
}
}
@@ -1224,17 +1224,17 @@ float Creature::GetSpellDamageMod(int32 Rank)
switch (Rank) // define rates for each elite rank
{
case CREATURE_ELITE_NORMAL:
return sWorld.getRate(RATE_CREATURE_NORMAL_SPELLDAMAGE);
return sWorld->getRate(RATE_CREATURE_NORMAL_SPELLDAMAGE);
case CREATURE_ELITE_ELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE);
return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE);
case CREATURE_ELITE_RAREELITE:
return sWorld.getRate(RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE);
return sWorld->getRate(RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE);
case CREATURE_ELITE_WORLDBOSS:
return sWorld.getRate(RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE);
return sWorld->getRate(RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE);
case CREATURE_ELITE_RARE:
return sWorld.getRate(RATE_CREATURE_ELITE_RARE_SPELLDAMAGE);
return sWorld->getRate(RATE_CREATURE_ELITE_RARE_SPELLDAMAGE);
default:
return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE);
return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE);
}
}
@@ -1251,7 +1251,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3
CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry);
if (!cinfo)
{
sLog.outErrorDb("Creature entry %u does not exist.", Entry);
sLog->outErrorDb("Creature entry %u does not exist.", Entry);
return false;
}
@@ -1277,7 +1277,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
if (!data)
{
sLog.outErrorDb("Creature (GUID: %u) not found in table `creature`, can't load. ",guid);
sLog->outErrorDb("Creature (GUID: %u) not found in table `creature`, can't load. ",guid);
return false;
}
@@ -1392,7 +1392,7 @@ void Creature::DeleteFromDB()
{
if (!m_DBTableGuid)
{
sLog.outDebug("Trying to delete not saved creature!");
sLog->outDebug("Trying to delete not saved creature!");
return;
}
@@ -1436,7 +1436,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
if (who->isInCombat())
if (Unit *victim = who->getAttackerForHelper())
if (IsWithinDistInMap(victim, sWorld.getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)))
if (IsWithinDistInMap(victim, sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)))
force = true;
if (!force && (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who) + m_CombatDistance)))
@@ -1451,7 +1451,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
float Creature::GetAttackDistance(Unit const* pl) const
{
float aggroRate = sWorld.getRate(RATE_CREATURE_AGGRO);
float aggroRate = sWorld->getRate(RATE_CREATURE_AGGRO);
if (aggroRate == 0)
return 0.0f;
@@ -1471,7 +1471,7 @@ float Creature::GetAttackDistance(Unit const* pl) const
// radius grow if playlevel < creaturelevel
RetDistance -= (float)leveldif;
if (creaturelevel+5 <= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
if (creaturelevel+5 <= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
// detect range auras
RetDistance += GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE);
@@ -1495,7 +1495,7 @@ void Creature::setDeathState(DeathState s)
m_respawnTime = time(NULL) + m_respawnDelay + m_corpseDelay;
// always save boss respawn time at death to prevent crash cheating
if (sWorld.getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss())
if (sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss())
SaveRespawnTime();
}
Unit::setDeathState(s);
@@ -1589,7 +1589,7 @@ void Creature::Respawn(bool force)
if (m_DBTableGuid)
sObjectMgr->RemoveCreatureRespawnTime(m_DBTableGuid, GetInstanceId());
sLog.outStaticDebug("Respawning...");
sLog->outStaticDebug("Respawning...");
m_respawnTime = 0;
lootForPickPocketed = false;
lootForBody = false;
@@ -1687,7 +1687,7 @@ SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim)
SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_spells[i]);
if (!spellInfo)
{
sLog.outError("WORLD: unknown spell id %i", m_spells[i]);
sLog->outError("WORLD: unknown spell id %i", m_spells[i]);
continue;
}
@@ -1737,7 +1737,7 @@ SpellEntry const *Creature::reachWithSpellCure(Unit *pVictim)
SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_spells[i]);
if (!spellInfo)
{
sLog.outError("WORLD: unknown spell id %i", m_spells[i]);
sLog->outError("WORLD: unknown spell id %i", m_spells[i]);
continue;
}
@@ -1809,7 +1809,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
Unit *target = NULL;
if (dist > ATTACK_DISTANCE)
sLog.outError("Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > ATTACK_DISTANCE. Extra distance ignored.",GetGUIDLow(),GetEntry());
sLog->outError("Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > ATTACK_DISTANCE. Extra distance ignored.",GetGUIDLow(),GetEntry());
{
Trinity::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
@@ -1834,7 +1834,7 @@ void Creature::SendAIReaction(AiReaction reactionType)
((WorldObject*)this)->SendMessageToSet(&data, true);
sLog.outDebug("WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType);
sLog->outDebug("WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType);
}
void Creature::CallAssistance()
@@ -1843,7 +1843,7 @@ void Creature::CallAssistance()
{
SetNoCallAssistance(true);
float radius = sWorld.getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS);
float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS);
if (radius > 0)
{
@@ -1872,7 +1872,7 @@ void Creature::CallAssistance()
e->AddAssistant((*assistList.begin())->GetGUID());
assistList.pop_front();
}
m_Events.AddEvent(e, m_Events.CalculateTime(sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY)));
m_Events.AddEvent(e, m_Events.CalculateTime(sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY)));
}
}
}
@@ -1992,7 +1992,7 @@ bool Creature::canCreatureAttack(Unit const *pVictim, bool force) const
return true;
//Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick.
float dist = std::max(GetAttackDistance(pVictim), sWorld.getFloatConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance;
float dist = std::max(GetAttackDistance(pVictim), sWorld->getFloatConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance;
if (Unit *unit = GetCharmerOrOwner())
return pVictim->IsWithinDist(unit, dist);
@@ -2065,7 +2065,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
SpellEntry const *AdditionalSpellInfo = sSpellStore.LookupEntry(cAura->spell_id);
if (!AdditionalSpellInfo)
{
sLog.outErrorDb("Creature (GUID: %u Entry: %u) has wrong spell %u defined in `auras` field.",GetGUIDLow(),GetEntry(),cAura->spell_id);
sLog->outErrorDb("Creature (GUID: %u Entry: %u) has wrong spell %u defined in `auras` field.",GetGUIDLow(),GetEntry(),cAura->spell_id);
continue;
}
@@ -2073,13 +2073,13 @@ bool Creature::LoadCreaturesAddon(bool reload)
if (HasAura(cAura->spell_id))
{
if (!reload)
sLog.outErrorDb("Creature (GUID: %u Entry: %u) has duplicate aura (spell %u) in `auras` field.",GetGUIDLow(),GetEntry(),cAura->spell_id);
sLog->outErrorDb("Creature (GUID: %u Entry: %u) has duplicate aura (spell %u) in `auras` field.",GetGUIDLow(),GetEntry(),cAura->spell_id);
continue;
}
AddAura(AdditionalSpellInfo, cAura->effectMask, this);
sLog.outDebug("Spell: %u with AuraEffectMask %u added to creature (GUID: %u Entry: %u)", cAura->spell_id, cAura->effectMask,GetGUIDLow(),GetEntry());
sLog->outDebug("Spell: %u with AuraEffectMask %u added to creature (GUID: %u Entry: %u)", cAura->spell_id, cAura->effectMask,GetGUIDLow(),GetEntry());
}
}
return true;
@@ -2092,14 +2092,14 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker)
WorldPacket data(SMSG_ZONE_UNDER_ATTACK,4);
data << (uint32)GetAreaId();
sWorld.SendGlobalMessage(&data,NULL,(enemy_team == ALLIANCE ? HORDE : ALLIANCE));
sWorld->SendGlobalMessage(&data,NULL,(enemy_team == ALLIANCE ? HORDE : ALLIANCE));
}
void Creature::SetInCombatWithZone()
{
if (!CanHaveThreatList())
{
sLog.outError("Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry());
sLog->outError("Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry());
return;
}
@@ -2107,7 +2107,7 @@ void Creature::SetInCombatWithZone()
if (!pMap->IsDungeon())
{
sLog.outError("Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), pMap->GetId());
sLog->outError("Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), pMap->GetId());
return;
}
@@ -2238,7 +2238,7 @@ void Creature::AllLootRemovedFromCorpse()
float decayRate;
CreatureInfo const *cinfo = GetCreatureInfo();
decayRate = sWorld.getRate(RATE_CORPSE_DECAY_LOOTED);
decayRate = sWorld->getRate(RATE_CORPSE_DECAY_LOOTED);
uint32 diff = uint32((m_corpseRemoveTime - now) * decayRate);
m_respawnTime -= diff;
@@ -2256,7 +2256,7 @@ uint8 Creature::getLevelForTarget(WorldObject const* target) const
if (!isWorldBoss() || !target->ToUnit())
return Unit::getLevelForTarget(target);
uint16 level = target->ToUnit()->getLevel() + sWorld.getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
uint16 level = target->ToUnit()->getLevel() + sWorld->getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
if (level < 1)
return 1;
if (level > 255)
@@ -37,13 +37,13 @@ void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature *member)
//Add member to an existing group
if (itr != map->CreatureGroupHolder.end())
{
sLog.outDebug("Group found: %u, inserting creature GUID: %u, Group InstanceID %u", groupId, member->GetGUIDLow(), member->GetInstanceId());
sLog->outDebug("Group found: %u, inserting creature GUID: %u, Group InstanceID %u", groupId, member->GetGUIDLow(), member->GetInstanceId());
itr->second->AddMember(member);
}
//Create new group
else
{
sLog.outDebug("Group not found: %u. Creating new group.", groupId);
sLog->outDebug("Group not found: %u. Creating new group.", groupId);
CreatureGroup* group = new CreatureGroup(groupId);
map->CreatureGroupHolder[groupId] = group;
group->AddMember(member);
@@ -52,7 +52,7 @@ void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature *member)
void CreatureGroupManager::RemoveCreatureFromGroup(CreatureGroup *group, Creature *member)
{
sLog.outDebug("Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow());
sLog->outDebug("Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow());
group->RemoveMember(member);
if (group->isEmpty())
@@ -61,7 +61,7 @@ void CreatureGroupManager::RemoveCreatureFromGroup(CreatureGroup *group, Creatur
if (!map)
return;
sLog.outDebug("Deleting group with InstanceID %u", member->GetInstanceId());
sLog->outDebug("Deleting group with InstanceID %u", member->GetInstanceId());
map->CreatureGroupHolder.erase(group->GetId());
delete group;
}
@@ -80,8 +80,8 @@ void CreatureGroupManager::LoadCreatureFormations()
if (!result)
{
sLog.outErrorDb(">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!");
sLog.outString();
sLog->outErrorDb(">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!");
sLog->outString();
return;
}
@@ -129,14 +129,14 @@ void CreatureGroupManager::LoadCreatureFormations()
{
if (guidSet.find(group_member->leaderGUID) == guidSet.end())
{
sLog.outErrorDb("creature_formations table leader guid %u incorrect (not exist)", group_member->leaderGUID);
sLog->outErrorDb("creature_formations table leader guid %u incorrect (not exist)", group_member->leaderGUID);
delete group_member;
continue;
}
if (guidSet.find(memberGUID) == guidSet.end())
{
sLog.outErrorDb("creature_formations table member guid %u incorrect (not exist)", memberGUID);
sLog->outErrorDb("creature_formations table member guid %u incorrect (not exist)", memberGUID);
delete group_member;
continue;
}
@@ -147,18 +147,18 @@ void CreatureGroupManager::LoadCreatureFormations()
}
while (result->NextRow()) ;
sLog.outString(">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog.outString();
sLog->outString(">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
void CreatureGroup::AddMember(Creature *member)
{
sLog.outDebug("CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow());
sLog->outDebug("CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow());
//Check if it is a leader
if (member->GetDBTableGUIDLow() == m_groupID)
{
sLog.outDebug("Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow());
sLog->outDebug("Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow());
m_leader = member;
}
@@ -187,7 +187,7 @@ void CreatureGroup::MemberAttackStart(Creature *member, Unit *target)
for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
if (m_leader) // avoid crash if leader was killed and reset.
sLog.outDebug("GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId());
sLog->outDebug("GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId());
//Skip one check
if (itr->first == member)
@@ -214,7 +214,7 @@ void CreatureGroup::FormationReset(bool dismiss)
itr->first->GetMotionMaster()->Initialize();
else
itr->first->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE);
sLog.outDebug("Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow());
sLog->outDebug("Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow());
}
}
m_Formed = !dismiss;
@@ -40,7 +40,7 @@ class CreatureGroupManager
void LoadCreatureFormations();
};
#define formation_mgr (*ACE_Singleton<CreatureGroupManager, ACE_Null_Mutex>::instance())
#define sFormationMgr ACE_Singleton<CreatureGroupManager, ACE_Null_Mutex>::instance()
typedef UNORDERED_MAP<uint32/*memberDBGUID*/, FormationInfo*> CreatureGroupInfoType;
@@ -59,7 +59,7 @@ class CreatureGroup
public:
//Group cannot be created empty
explicit CreatureGroup(uint32 id) : m_leader(NULL), m_groupID(id), m_Formed(false) {}
~CreatureGroup() { sLog.outDebug("Destroying group"); }
~CreatureGroup() { sLog->outDebug("Destroying group"); }
Creature* getLeader() const { return m_leader; }
uint32 GetId() const { return m_groupID; }
+13 -13
View File
@@ -198,7 +198,7 @@ void PlayerMenu::SendPointOfInterest(float X, float Y, uint32 Icon, uint32 Flags
data << locName;
pSession->SendPacket(&data);
//sLog.outDebug("WORLD: Sent SMSG_GOSSIP_POI");
//sLog->outDebug("WORLD: Sent SMSG_GOSSIP_POI");
}
void PlayerMenu::SendPointOfInterest(uint32 poi_id)
@@ -206,7 +206,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id)
PointOfInterest const* poi = sObjectMgr->GetPointOfInterest(poi_id);
if (!poi)
{
sLog.outErrorDb("Request to send non-existing POI (Id: %u), ignored.",poi_id);
sLog->outErrorDb("Request to send non-existing POI (Id: %u), ignored.",poi_id);
return;
}
@@ -226,7 +226,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id)
data << icon_name;
pSession->SendPacket(&data);
//sLog.outDebug("WORLD: Sent SMSG_GOSSIP_POI");
//sLog->outDebug("WORLD: Sent SMSG_GOSSIP_POI");
}
void PlayerMenu::SendTalking(uint32 textID)
@@ -297,7 +297,7 @@ void PlayerMenu::SendTalking(uint32 textID)
}
pSession->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE ");
sLog->outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE ");
}
void PlayerMenu::SendTalking(char const * title, char const * text)
@@ -320,7 +320,7 @@ void PlayerMenu::SendTalking(char const * title, char const * text)
pSession->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE ");
sLog->outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE ");
}
/*********************************************************/
@@ -406,7 +406,7 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title
data.put<uint8>(count_pos, count);
pSession->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID));
sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID));
}
void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID)
@@ -416,7 +416,7 @@ void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID)
data << uint8(questStatus);
pSession->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus);
sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus);
}
void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID, bool ActivateAccept)
@@ -497,7 +497,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID,
}
data << uint32(pQuest->GetRewOrReqMoney());
data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld.getRate(RATE_XP_QUEST));
data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld->getRate(RATE_XP_QUEST));
}
// rewarded honor points. Multiply with 10 to satisfy client
@@ -527,7 +527,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID,
}
pSession->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId());
sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId());
}
void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest)
@@ -667,7 +667,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest)
data << ObjectiveText[iI];
pSession->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", pQuest->GetQuestId());
sLog->outDebug("WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", pQuest->GetQuestId());
}
void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID, bool EnableNext)
@@ -741,7 +741,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID,
}
data << uint32(pQuest->GetRewOrReqMoney());
data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld.getRate(RATE_XP_QUEST));
data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld->getRate(RATE_XP_QUEST));
// rewarded honor points. Multiply with 10 to satisfy client
data << 10 * Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorMultiplier());
@@ -764,7 +764,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID,
data << uint32(pQuest->RewRepValue[i]);
pSession->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId());
sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId());
}
void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, uint64 npcGUID, bool Completable, bool CloseOnCancel)
@@ -844,5 +844,5 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, uint64 npcGUID,
data << uint32(0x10);
pSession->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId());
sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId());
}
@@ -159,7 +159,7 @@ void TempSummon::Update(uint32 diff)
}
default:
UnSummon();
sLog.outError("Temporary summoned creature (entry: %u) have unknown type %u of ",GetEntry(),m_type);
sLog->outError("Temporary summoned creature (entry: %u) have unknown type %u of ",GetEntry(),m_type);
break;
}
}
@@ -253,7 +253,7 @@ void TempSummon::RemoveFromWorld()
owner->m_SummonSlot[slot] = 0;
//if (GetOwnerGUID())
// sLog.outError("Unit %u has owner guid when removed from world", GetEntry());
// sLog->outError("Unit %u has owner guid when removed from world", GetEntry());
Creature::RemoveFromWorld();
}
@@ -45,7 +45,7 @@ void DynamicObject::AddToWorld()
///- Register the dynamicObject for guid lookup
if (!IsInWorld())
{
sObjectAccessor.AddObject(this);
sObjectAccessor->AddObject(this);
WorldObject::AddToWorld();
}
}
@@ -64,11 +64,11 @@ void DynamicObject::RemoveFromWorld()
}
else
{
sLog.outCrash("DynamicObject::RemoveFromWorld cannot find viewpoint owner");
sLog->outCrash("DynamicObject::RemoveFromWorld cannot find viewpoint owner");
}
}
WorldObject::RemoveFromWorld();
sObjectAccessor.RemoveObject(this);
sObjectAccessor->RemoveObject(this);
}
}
@@ -78,7 +78,7 @@ bool DynamicObject::Create(uint32 guidlow, Unit *caster, uint32 spellId, const P
Relocate(pos);
if (!IsPositionValid())
{
sLog.outError("DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",spellId,GetPositionX(),GetPositionY());
sLog->outError("DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",spellId,GetPositionX(),GetPositionY());
return false;
}
@@ -112,7 +112,7 @@ void GameObject::CleanupsBeforeDelete(bool /*finalCleanup*/)
else if (IS_PET_GUID(owner_guid))
ownerType = "pet";
sLog.outError("Delete GameObject (GUID: %u Entry: %u SpellId %u LinkedGO %u) that lost references to owner (GUID %u Type '%s') GO list. Crash possible later.",
sLog->outError("Delete GameObject (GUID: %u Entry: %u SpellId %u LinkedGO %u) that lost references to owner (GUID %u Type '%s') GO list. Crash possible later.",
GetGUIDLow(), GetGOInfo()->id, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), GUID_LOPART(owner_guid), ownerType);
}
}
@@ -127,7 +127,7 @@ void GameObject::AddToWorld()
if (m_zoneScript)
m_zoneScript->OnGameObjectCreate(this);
sObjectAccessor.AddObject(this);
sObjectAccessor->AddObject(this);
WorldObject::AddToWorld();
}
}
@@ -146,10 +146,10 @@ void GameObject::RemoveFromWorld()
if (Unit * owner = GetOwner())
owner->RemoveGameObject(this,false);
else
sLog.outError("Delete GameObject (GUID: %u Entry: %u) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid));
sLog->outError("Delete GameObject (GUID: %u Entry: %u) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid));
}
WorldObject::RemoveFromWorld();
sObjectAccessor.RemoveObject(this);
sObjectAccessor->RemoveObject(this);
}
}
@@ -161,7 +161,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
Relocate(x,y,z,ang);
if (!IsPositionValid())
{
sLog.outError("Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y);
sLog->outError("Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y);
return false;
}
@@ -178,7 +178,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(name_id);
if (!goinfo)
{
sLog.outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3);
sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3);
return false;
}
@@ -188,7 +188,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
if (goinfo->type >= MAX_GAMEOBJECT_TYPE)
{
sLog.outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.",guidlow,name_id,goinfo->type);
sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.",guidlow,name_id,goinfo->type);
return false;
}
@@ -257,7 +257,7 @@ void GameObject::Update(uint32 diff)
if(!AI())
{
if (!AIM_Initialize())
sLog.outError("Could not initialize GameObjectAI");
sLog->outError("Could not initialize GameObjectAI");
} else
AI()->UpdateAI(diff);
@@ -560,7 +560,7 @@ void GameObject::Update(uint32 diff)
m_respawnTime = time(NULL) + m_respawnDelayTime;
// if option not set then object will be saved at grid unload
if (sWorld.getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
if (sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
SaveRespawnTime();
UpdateObjectVisibility();
@@ -627,7 +627,7 @@ void GameObject::SaveToDB()
GameObjectData const *data = sObjectMgr->GetGOData(m_DBTableGuid);
if (!data)
{
sLog.outError("GameObject::SaveToDB failed, cannot get gameobject data!");
sLog->outError("GameObject::SaveToDB failed, cannot get gameobject data!");
return;
}
@@ -696,7 +696,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
if (!data)
{
sLog.outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid);
sLog->outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid);
return false;
}
@@ -1161,7 +1161,7 @@ void GameObject::Use(Unit* user)
if (info->goober.eventId)
{
sLog.outDebug("Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow());
sLog->outDebug("Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow());
GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this);
EventInform(info->goober.eventId);
}
@@ -1245,7 +1245,7 @@ void GameObject::Use(Unit* user)
//provide error, no fishable zone or area should be 0
if (!zone_skill)
sLog.outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.",subzone);
sLog->outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.",subzone);
int32 skill = player->GetSkillValue(SKILL_FISHING);
@@ -1261,7 +1261,7 @@ void GameObject::Use(Unit* user)
int32 roll = irand(1,100);
sLog.outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i",skill,zone_skill,chance,roll);
sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i",skill,zone_skill,chance,roll);
// but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
if (chance >= roll)
@@ -1548,7 +1548,7 @@ void GameObject::Use(Unit* user)
return;
}
default:
sLog.outDebug("Unknown Object Type %u", GetGoType());
sLog->outDebug("Unknown Object Type %u", GetGoType());
break;
}
@@ -1559,9 +1559,9 @@ void GameObject::Use(Unit* user)
if (!spellInfo)
{
if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell((Player*)user,spellId,this))
sLog.outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId,GetEntry(),GetGoType());
sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId,GetEntry(),GetGoType());
else
sLog.outDebug("WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId);
sLog->outDebug("WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId);
return;
}
@@ -41,7 +41,7 @@ Bag::~Bag()
{
if (item->IsInWorld())
{
sLog.outCrash("Item %u (slot %u, bag slot %u) in bag %u (slot %u, bag slot %u, m_bagslot %u) is to be deleted but is still in world.",
sLog->outCrash("Item %u (slot %u, bag slot %u) in bag %u (slot %u, bag slot %u, m_bagslot %u) is to be deleted but is still in world.",
item->GetEntry(), (uint32)item->GetSlot(), (uint32)item->GetBagSlot(),
GetEntry(), (uint32)GetSlot(), (uint32)GetBagSlot(), (uint32)i);
item->RemoveFromWorld();
+9 -9
View File
@@ -37,7 +37,7 @@ void AddItemsSetItem(Player*player,Item *item)
if (!set)
{
sLog.outErrorDb("Item set %u for item (id %u) not found, mods not applied.",setid,proto->ItemId);
sLog->outErrorDb("Item set %u for item (id %u) not found, mods not applied.",setid,proto->ItemId);
return;
}
@@ -98,7 +98,7 @@ void AddItemsSetItem(Player*player,Item *item)
SpellEntry const *spellInfo = sSpellStore.LookupEntry(set->spells[x]);
if (!spellInfo)
{
sLog.outError("WORLD: unknown spell id %u in items set %u effects", set->spells[x],setid);
sLog->outError("WORLD: unknown spell id %u in items set %u effects", set->spells[x],setid);
break;
}
@@ -119,7 +119,7 @@ void RemoveItemsSetItem(Player*player,ItemPrototype const *proto)
if (!set)
{
sLog.outErrorDb("Item set #%u for item #%u not found, mods not removed.",setid,proto->ItemId);
sLog->outErrorDb("Item set #%u for item #%u not found, mods not removed.",setid,proto->ItemId);
return;
}
@@ -286,7 +286,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
if (!GetUInt32Value(ITEM_FIELD_DURATION))
return;
sLog.outDebug("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff);
sLog->outDebug("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff);
if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff)
{
@@ -566,7 +566,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
// item can have not null only one from field values
if ((itemProto->RandomProperty) && (itemProto->RandomSuffix))
{
sLog.outErrorDb("Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0",itemProto->ItemId,itemProto->RandomProperty,itemProto->RandomSuffix);
sLog->outErrorDb("Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0",itemProto->ItemId,itemProto->RandomProperty,itemProto->RandomSuffix);
return 0;
}
@@ -577,7 +577,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
ItemRandomPropertiesEntry const *random_id = sItemRandomPropertiesStore.LookupEntry(randomPropId);
if (!random_id)
{
sLog.outErrorDb("Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'",randomPropId);
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'",randomPropId);
return 0;
}
@@ -590,7 +590,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
ItemRandomSuffixEntry const *random_id = sItemRandomSuffixStore.LookupEntry(randomPropId);
if (!random_id)
{
sLog.outErrorDb("Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.",randomPropId);
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.",randomPropId);
return 0;
}
@@ -680,7 +680,7 @@ void Item::AddToUpdateQueueOf(Player *player)
if (player->GetGUID() != GetOwnerGUID())
{
sLog.outDebug("Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
sLog->outDebug("Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
return;
}
@@ -700,7 +700,7 @@ void Item::RemoveFromUpdateQueueOf(Player *player)
if (player->GetGUID() != GetOwnerGUID())
{
sLog.outDebug("Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
sLog->outDebug("Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow());
return;
}
@@ -69,13 +69,13 @@ void LoadRandomEnchantmentsTable()
++count;
} while (result->NextRow());
sLog.outString(">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog.outString();
sLog->outString(">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
else
{
sLog.outErrorDb(">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
sLog.outString();
sLog->outErrorDb(">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
sLog->outString();
}
}
@@ -90,7 +90,7 @@ uint32 GetItemEnchantMod(int32 entry)
EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry);
if (tab == RandomItemEnch.end())
{
sLog.outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.",entry);
sLog->outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.",entry);
return 0;
}
+57 -57
View File
@@ -86,7 +86,7 @@ WorldObject::~WorldObject()
{
if (GetTypeId() == TYPEID_CORPSE)
{
sLog.outCrash("Object::~Object Corpse guid="UI64FMTD", type=%d, entry=%u deleted but still in map!!", GetGUID(), ((Corpse*)this)->GetType(), GetEntry());
sLog->outCrash("Object::~Object Corpse guid="UI64FMTD", type=%d, entry=%u deleted but still in map!!", GetGUID(), ((Corpse*)this)->GetType(), GetEntry());
ASSERT(false);
}
ResetMap();
@@ -97,18 +97,18 @@ Object::~Object()
{
if (IsInWorld())
{
sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry());
sLog->outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry());
if (isType(TYPEMASK_ITEM))
sLog.outCrash("Item slot %u", ((Item*)this)->GetSlot());
sLog->outCrash("Item slot %u", ((Item*)this)->GetSlot());
ASSERT(false);
RemoveFromWorld();
}
if (m_objectUpdated)
{
sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry());
sLog->outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry());
ASSERT(false);
sObjectAccessor.RemoveUpdateObject(this);
sObjectAccessor->RemoveUpdateObject(this);
}
delete [] m_uint32Values;
@@ -211,7 +211,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) c
}
}
//sLog.outDebug("BuildCreateUpdate: update-type: %u, object-type: %u got flags: %X, flags2: %X", updatetype, m_objectTypeId, flags, flags2);
//sLog->outDebug("BuildCreateUpdate: update-type: %u, object-type: %u got flags: %X, flags2: %X", updatetype, m_objectTypeId, flags, flags2);
ByteBuffer buf(500);
buf << (uint8)updatetype;
@@ -635,7 +635,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
// FG: pretend that OTHER players in own group are friendly ("blue")
else if (index == UNIT_FIELD_BYTES_2 || index == UNIT_FIELD_FACTIONTEMPLATE)
{
if (((Unit*)this)->IsControlledByPlayer() && target != this && sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && ((Unit*)this)->IsInRaidWith(target))
if (((Unit*)this)->IsControlledByPlayer() && target != this && sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && ((Unit*)this)->IsInRaidWith(target))
{
FactionTemplateEntry const *ft1, *ft2;
ft1 = ((Unit*)this)->getFactionTemplateEntry();
@@ -741,7 +741,7 @@ void Object::ClearUpdateMask(bool remove)
if (m_objectUpdated)
{
if (remove)
sObjectAccessor.RemoveUpdateObject(this);
sObjectAccessor->RemoveUpdateObject(this);
m_objectUpdated = false;
}
}
@@ -824,7 +824,7 @@ void Object::SetInt32Value(uint16 index, int32 value)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -843,7 +843,7 @@ void Object::SetUInt32Value(uint16 index, uint32 value)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -869,7 +869,7 @@ void Object::SetUInt64Value(uint16 index, const uint64 &value)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -888,7 +888,7 @@ bool Object::AddUInt64Value(uint16 index, const uint64 &value)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -909,7 +909,7 @@ bool Object::RemoveUInt64Value(uint16 index, const uint64 &value)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -930,7 +930,7 @@ void Object::SetFloatValue(uint16 index, float value)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -943,7 +943,7 @@ void Object::SetByteValue(uint16 index, uint8 offset, uint8 value)
if (offset > 4)
{
sLog.outError("Object::SetByteValue: wrong offset %u", offset);
sLog->outError("Object::SetByteValue: wrong offset %u", offset);
return;
}
@@ -956,7 +956,7 @@ void Object::SetByteValue(uint16 index, uint8 offset, uint8 value)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -969,7 +969,7 @@ void Object::SetUInt16Value(uint16 index, uint8 offset, uint16 value)
if (offset > 2)
{
sLog.outError("Object::SetUInt16Value: wrong offset %u", offset);
sLog->outError("Object::SetUInt16Value: wrong offset %u", offset);
return;
}
@@ -982,7 +982,7 @@ void Object::SetUInt16Value(uint16 index, uint8 offset, uint16 value)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -1051,7 +1051,7 @@ void Object::SetFlag(uint16 index, uint32 newFlag)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -1074,7 +1074,7 @@ void Object::RemoveFlag(uint16 index, uint32 oldFlag)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -1087,7 +1087,7 @@ void Object::SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
if (offset > 4)
{
sLog.outError("Object::SetByteFlag: wrong offset %u", offset);
sLog->outError("Object::SetByteFlag: wrong offset %u", offset);
return;
}
@@ -1099,7 +1099,7 @@ void Object::SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -1112,7 +1112,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag)
if (offset > 4)
{
sLog.outError("Object::RemoveByteFlag: wrong offset %u", offset);
sLog->outError("Object::RemoveByteFlag: wrong offset %u", offset);
return;
}
@@ -1124,7 +1124,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -1133,7 +1133,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag)
bool Object::PrintIndexError(uint32 index, bool set) const
{
sLog.outError("Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u",(set ? "set value to" : "get value from"),index,m_valuesCount,GetTypeId(),m_objectType);
sLog->outError("Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u",(set ? "set value to" : "get value from"),index,m_valuesCount,GetTypeId(),m_objectType);
// ASSERT must fail after function call
return false;
@@ -1188,34 +1188,34 @@ ByteBuffer & operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const &
void MovementInfo::OutDebug()
{
sLog.outString("MOVEMENT INFO");
sLog.outString("guid " UI64FMTD, guid);
sLog.outString("flags %u", flags);
sLog.outString("flags2 %u", flags2);
sLog.outString("time %u current time " UI64FMTD "", flags2, uint64(::time(NULL)));
sLog.outString("position: `%s`", pos.ToString().c_str());
sLog->outString("MOVEMENT INFO");
sLog->outString("guid " UI64FMTD, guid);
sLog->outString("flags %u", flags);
sLog->outString("flags2 %u", flags2);
sLog->outString("time %u current time " UI64FMTD "", flags2, uint64(::time(NULL)));
sLog->outString("position: `%s`", pos.ToString().c_str());
if (flags & MOVEMENTFLAG_ONTRANSPORT)
{
sLog.outString("TRANSPORT:");
sLog.outString("guid: " UI64FMTD, t_guid);
sLog.outString("position: `%s`", t_pos.ToString().c_str());
sLog.outString("seat: %i", t_seat);
sLog.outString("time: %u", t_time);
sLog->outString("TRANSPORT:");
sLog->outString("guid: " UI64FMTD, t_guid);
sLog->outString("position: `%s`", t_pos.ToString().c_str());
sLog->outString("seat: %i", t_seat);
sLog->outString("time: %u", t_time);
if (flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT)
sLog.outString("time2: %u", t_time2);
sLog->outString("time2: %u", t_time2);
}
if ((flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING))
{
sLog.outString("pitch: %f", pitch);
sLog->outString("pitch: %f", pitch);
}
sLog.outString("fallTime: %u", fallTime);
sLog->outString("fallTime: %u", fallTime);
if (flags & MOVEMENTFLAG_JUMPING)
{
sLog.outString("j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed);
sLog->outString("j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed);
}
if (flags & MOVEMENTFLAG_SPLINE_ELEVATION)
{
sLog.outString("splineElevation: %f", splineElevation);
sLog->outString("splineElevation: %f", splineElevation);
}
}
@@ -1582,21 +1582,21 @@ void WorldObject::MonsterSay(const char* text, uint32 language, uint64 TargetGui
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,CHAT_MSG_MONSTER_SAY,text,language,GetName(),TargetGuid);
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY),true);
SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY),true);
}
void WorldObject::MonsterYell(const char* text, uint32 language, uint64 TargetGuid)
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,GetName(),TargetGuid);
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL),true);
SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL),true);
}
void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote)
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE,text,LANG_UNIVERSAL,GetName(),TargetGuid);
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true);
SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true);
}
void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper)
@@ -1861,7 +1861,7 @@ void Object::ForceValuesUpdateAtIndex(uint32 i)
{
if (!m_objectUpdated)
{
sObjectAccessor.AddUpdateObject(this);
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -1901,9 +1901,9 @@ void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid)
Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid);
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY),say_do);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY),say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
}
void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
@@ -1916,9 +1916,9 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid);
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL),say_do);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL),say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
}
void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid)
@@ -1944,9 +1944,9 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE
Trinity::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid);
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),say_do);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
}
void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper)
@@ -2017,7 +2017,7 @@ void WorldObject::SetMap(Map * map)
return;
if (m_currMap)
{
sLog.outCrash("WorldObject::SetMap: obj %u new map %u %u, old map %u %u", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId());
sLog->outCrash("WorldObject::SetMap: obj %u new map %u %u, old map %u %u", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId());
ASSERT(false);
}
m_currMap = map;
@@ -2052,7 +2052,7 @@ void WorldObject::AddObjectToRemoveList()
Map* map = FindMap();
if (!map)
{
sLog.outError("Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).",GetTypeId(),GetEntry(),GetGUIDLow(),GetMapId());
sLog->outError("Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).",GetTypeId(),GetEntry(),GetGUIDLow(),GetMapId());
return;
}
@@ -2188,7 +2188,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
pet->Relocate(x, y, z, ang);
if (!pet->IsPositionValid())
{
sLog.outError("Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)",pet->GetGUIDLow(),pet->GetEntry(),pet->GetPositionX(),pet->GetPositionY());
sLog->outError("Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)",pet->GetGUIDLow(),pet->GetEntry(),pet->GetPositionX(),pet->GetPositionY());
delete pet;
return NULL;
}
@@ -2197,7 +2197,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
uint32 pet_number = sObjectMgr->GeneratePetNumber();
if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
{
sLog.outError("no such creature entry %u", entry);
sLog->outError("no such creature entry %u", entry);
delete pet;
return NULL;
}
@@ -2274,7 +2274,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(entry);
if (!goinfo)
{
sLog.outErrorDb("Gameobject template %u not found in database!", entry);
sLog->outErrorDb("Gameobject template %u not found in database!", entry);
return NULL;
}
Map *map = GetMap();
@@ -2451,7 +2451,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
/*
// if detection disabled, return first point
if (!sWorld.getIntConfig(CONFIG_DETECT_POS_COLLISION))
if (!sWorld->getIntConfig(CONFIG_DETECT_POS_COLLISION))
{
UpdateGroundPositionZ(x,y,z); // update to LOS height if available
return;
@@ -54,10 +54,10 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
c_stream.opaque = (voidpf)0;
// default Z_BEST_SPEED (1)
int z_res = deflateInit(&c_stream, sWorld.getIntConfig(CONFIG_COMPRESSION));
int z_res = deflateInit(&c_stream, sWorld->getIntConfig(CONFIG_COMPRESSION));
if (z_res != Z_OK)
{
sLog.outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)",z_res,zError(z_res));
sLog->outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)",z_res,zError(z_res));
*dst_size = 0;
return;
}
@@ -70,14 +70,14 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
z_res = deflate(&c_stream, Z_NO_FLUSH);
if (z_res != Z_OK)
{
sLog.outError("Can't compress update packet (zlib: deflate) Error code: %i (%s)",z_res,zError(z_res));
sLog->outError("Can't compress update packet (zlib: deflate) Error code: %i (%s)",z_res,zError(z_res));
*dst_size = 0;
return;
}
if (c_stream.avail_in != 0)
{
sLog.outError("Can't compress update packet (zlib: deflate not greedy)");
sLog->outError("Can't compress update packet (zlib: deflate not greedy)");
*dst_size = 0;
return;
}
@@ -85,7 +85,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
z_res = deflate(&c_stream, Z_FINISH);
if (z_res != Z_STREAM_END)
{
sLog.outError("Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)",z_res,zError(z_res));
sLog->outError("Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)",z_res,zError(z_res));
*dst_size = 0;
return;
}
@@ -93,7 +93,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
z_res = deflateEnd(&c_stream);
if (z_res != Z_OK)
{
sLog.outError("Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)",z_res,zError(z_res));
sLog->outError("Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)",z_res,zError(z_res));
*dst_size = 0;
return;
}
+22 -22
View File
@@ -73,7 +73,7 @@ void Pet::AddToWorld()
if (!IsInWorld())
{
///- Register the pet for guid lookup
sObjectAccessor.AddObject(this);
sObjectAccessor->AddObject(this);
Unit::AddToWorld();
AIM_Initialize();
}
@@ -97,7 +97,7 @@ void Pet::RemoveFromWorld()
{
///- Don't call the function for Creature, normal mobs + totems go in a different storage
Unit::RemoveFromWorld();
sObjectAccessor.RemoveObject(this);
sObjectAccessor->RemoveObject(this);
}
}
@@ -178,7 +178,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
if (!IsPositionValid())
{
sLog.outError("Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
sLog->outError("Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY());
return false;
}
@@ -224,7 +224,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
break;
default:
if (!IsPetGhoul())
sLog.outError("Pet have incorrect type (%u) for pet loading.", getPetType());
sLog->outError("Pet have incorrect type (%u) for pet loading.", getPetType());
break;
}
@@ -308,7 +308,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
CleanupActionBar(); // remove unknown spells from action bar after load
sLog.outDebug("New Pet has guid %u", GetGUIDLow());
sLog->outDebug("New Pet has guid %u", GetGUIDLow());
owner->PetSpellInitialize();
@@ -518,7 +518,7 @@ void Pet::Update(uint32 diff)
{
if (owner->GetPetGUID() != GetGUID())
{
sLog.outError("Pet %u is not pet of owner %s, removed", GetEntry(), m_owner->GetName());
sLog->outError("Pet %u is not pet of owner %s, removed", GetEntry(), m_owner->GetName());
Remove(getPetType() == HUNTER_PET?PET_SAVE_AS_DELETED:PET_SAVE_NOT_IN_SLOT);
return;
}
@@ -596,7 +596,7 @@ void Creature::Regenerate(Powers power)
case POWER_FOCUS:
{
// For hunter pets.
addvalue = 24 * sWorld.getRate(RATE_POWER_FOCUS);
addvalue = 24 * sWorld->getRate(RATE_POWER_FOCUS);
break;
}
case POWER_ENERGY:
@@ -696,7 +696,7 @@ void Pet::GivePetXP(uint32 xp)
if (!isAlive())
return;
uint8 maxlevel = std::min((uint8)sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL), GetOwner()->getLevel());
uint8 maxlevel = std::min((uint8)sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL), GetOwner()->getLevel());
uint8 petlevel = getLevel();
// If pet is detected to be at, or above(?) the players level, don't hand out XP
@@ -749,7 +749,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
if (!IsPositionValid())
{
sLog.outError("Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)",
sLog->outError("Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)",
GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY());
return false;
}
@@ -757,14 +757,14 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
CreatureInfo const *cinfo = GetCreatureInfo();
if (!cinfo)
{
sLog.outError("CreateBaseAtCreature() failed, creatureInfo is missing!");
sLog->outError("CreateBaseAtCreature() failed, creatureInfo is missing!");
return false;
}
SetDisplayId(creature->GetDisplayId());
if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]);
SetName(cFamily->Name[sWorld->GetDefaultDbcLocale()]);
else
SetName(creature->GetNameForLocaleIdx(sObjectMgr->GetDBCLocaleIndex()));
@@ -777,7 +777,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureInfo const* cinfo, Unit * owner)
return false;
if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]);
SetName(cFamily->Name[sWorld->GetDefaultDbcLocale()]);
Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());
@@ -786,7 +786,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureInfo const* cinfo, Unit * owner)
bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseMask)
{
sLog.outDebug("Pet::CreateBaseForTamed");
sLog->outDebug("Pet::CreateBaseForTamed");
uint32 guid=sObjectMgr->GenerateLowGuid(HIGHGUID_PET);
uint32 pet_number = sObjectMgr->GeneratePetNumber();
if (!Create(guid, map, phaseMask, cinfo->Entry, pet_number))
@@ -832,7 +832,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
m_unitTypeMask |= UNIT_MASK_HUNTER_PET;
}
else
sLog.outError("Unknown type pet %u is summoned by player class %u", GetEntry(), m_owner->getClass());
sLog->outError("Unknown type pet %u is summoned by player class %u", GetEntry(), m_owner->getClass());
}
uint32 creature_ID = (petType == HUNTER_PET) ? 1 : cinfo->Entry;
@@ -1112,7 +1112,7 @@ void Pet::_LoadSpellCooldowns()
if (!sSpellStore.LookupEntry(spell_id))
{
sLog.outError("Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.",m_charmInfo->GetPetNumber(),spell_id);
sLog->outError("Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.",m_charmInfo->GetPetNumber(),spell_id);
continue;
}
@@ -1125,7 +1125,7 @@ void Pet::_LoadSpellCooldowns()
_AddCreatureSpellCooldown(spell_id,db_time);
sLog.outDebug("Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time-curTime));
sLog->outDebug("Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time-curTime));
}
while (result->NextRow());
@@ -1201,7 +1201,7 @@ void Pet::_SaveSpells(SQLTransaction& trans)
void Pet::_LoadAuras(uint32 timediff)
{
sLog.outDebug("Loading auras for pet %u",GetGUIDLow());
sLog->outDebug("Loading auras for pet %u",GetGUIDLow());
QueryResult result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber());
@@ -1230,7 +1230,7 @@ void Pet::_LoadAuras(uint32 timediff)
SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid);
if (!spellproto)
{
sLog.outError("Unknown aura (spellid %u), ignore.",spellid);
sLog->outError("Unknown aura (spellid %u), ignore.",spellid);
continue;
}
@@ -1261,7 +1261,7 @@ void Pet::_LoadAuras(uint32 timediff)
}
aura->SetLoadedState(maxduration,remaintime,remaincharges,stackcount,recalculatemask,&damage[0]);
aura->ApplyForTargets();
sLog.outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask);
sLog->outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask);
}
}
while (result->NextRow());
@@ -1317,11 +1317,11 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
// do pet spell book cleanup
if (state == PETSPELL_UNCHANGED) // spell load case
{
sLog.outError("Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.",spell_id);
sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.",spell_id);
CharacterDatabase.PExecute("DELETE FROM pet_spell WHERE spell = '%u'",spell_id);
}
else
sLog.outError("Pet::addSpell: Non-existed in SpellStore spell #%u request.",spell_id);
sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request.",spell_id);
return false;
}
@@ -1770,7 +1770,7 @@ void Pet::InitTalentForLevel()
uint32 Pet::resetTalentsCost() const
{
int64 days = int64(sWorld.GetGameTime() - m_resetTalentsTime)/DAY;
int64 days = int64(sWorld->GetGameTime() - m_resetTalentsTime)/DAY;
// The first time reset costs 10 silver; after 1 day cost is reset to 10 silver
if (m_resetTalentsCost < 10*SILVER || days > 0)
File diff suppressed because it is too large Load Diff
@@ -144,7 +144,7 @@ void PlayerSocial::SendSocialList(Player* plr)
}
plr->GetSession()->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_CONTACT_LIST");
sLog->outDebug("WORLD: Sent SMSG_CONTACT_LIST");
}
bool PlayerSocial::HasFriend(uint32 friend_guid)
@@ -187,8 +187,8 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
uint32 team = player->GetTeam();
AccountTypes security = player->GetSession()->GetSecurity();
bool allowTwoSideWhoList = sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
AccountTypes gmLevelInWhoList = AccountTypes (sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
bool allowTwoSideWhoList = sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
AccountTypes gmLevelInWhoList = AccountTypes (sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
PlayerSocialMap::iterator itr = player->GetSocial()->m_playerSocialMap.find(friendGUID);
if (itr != player->GetSocial()->m_playerSocialMap.end())
@@ -263,8 +263,8 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
uint32 team = player->GetTeam();
AccountTypes security = player->GetSession()->GetSecurity();
uint32 guid = player->GetGUIDLow();
AccountTypes gmLevelInWhoList = AccountTypes(sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
bool allowTwoSideWhoList = sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
AccountTypes gmLevelInWhoList = AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
bool allowTwoSideWhoList = sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
for (SocialMap::const_iterator itr = m_socialMap.begin(); itr != m_socialMap.end(); ++itr)
{
@@ -35,8 +35,8 @@ void MapManager::LoadTransports()
if (!result)
{
sLog.outString(">> Loaded 0 transports. DB table `transports` is empty!");
sLog.outString();
sLog->outString(">> Loaded 0 transports. DB table `transports` is empty!");
sLog->outString();
return;
}
@@ -58,26 +58,26 @@ void MapManager::LoadTransports()
if (!goinfo)
{
sLog.outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template missing", entry, name.c_str());
sLog->outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template missing", entry, name.c_str());
delete t;
continue;
}
if (goinfo->type != GAMEOBJECT_TYPE_MO_TRANSPORT)
{
sLog.outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template type wrong", entry, name.c_str());
sLog->outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template type wrong", entry, name.c_str());
delete t;
continue;
}
// sLog.outString("Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name);
// sLog->outString("Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name);
std::set<uint32> mapsUsed;
if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed))
// skip transports with empty waypoints list
{
sLog.outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.",goinfo->moTransport.taxiPathId);
sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.",goinfo->moTransport.taxiPathId);
delete t;
continue;
}
@@ -119,13 +119,13 @@ void MapManager::LoadTransports()
uint32 guid = fields[0].GetUInt32();
uint32 entry = fields[1].GetUInt32();
std::string name = fields[2].GetString();
sLog.outErrorDb("Transport %u '%s' have record (GUID: %u) in `gameobject`. Transports DON'T must have any records in `gameobject` or its behavior will be unpredictable/bugged.",entry,name.c_str(),guid);
sLog->outErrorDb("Transport %u '%s' have record (GUID: %u) in `gameobject`. Transports DON'T must have any records in `gameobject` or its behavior will be unpredictable/bugged.",entry,name.c_str(),guid);
}
while (result->NextRow());
}
sLog.outString(">> Loaded %u transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog.outString();
sLog->outString(">> Loaded %u transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
void MapManager::LoadTransportNPCs()
@@ -137,8 +137,8 @@ void MapManager::LoadTransportNPCs()
if (!result)
{
sLog.outString(">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!");
sLog.outString();
sLog->outString(">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!");
sLog->outString();
return;
}
@@ -169,8 +169,8 @@ void MapManager::LoadTransportNPCs()
}
while (result->NextRow());
sLog.outString(">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog.outString();
sLog->outString(">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
Transport::Transport(uint32 period, uint32 script) : GameObject(), m_period(period), ScriptId(script)
@@ -196,7 +196,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa
if (!IsPositionValid())
{
sLog.outError("Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
sLog->outError("Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
guidlow,x,y);
return false;
}
@@ -207,7 +207,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa
if (!goinfo)
{
sLog.outErrorDb("Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f",guidlow, mapid, x, y, z, ang);
sLog->outErrorDb("Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f",guidlow, mapid, x, y, z, ang);
return false;
}
@@ -354,7 +354,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
}
// for (int i = 0; i < keyFrames.size(); ++i) {
// sLog.outString("%f, %f, %f, %f, %f, %f, %f", keyFrames[i].x, keyFrames[i].y, keyFrames[i].distUntilStop, keyFrames[i].distSinceStop, keyFrames[i].distFromPrev, keyFrames[i].tFrom, keyFrames[i].tTo);
// sLog->outString("%f, %f, %f, %f, %f, %f, %f", keyFrames[i].x, keyFrames[i].y, keyFrames[i].distUntilStop, keyFrames[i].distSinceStop, keyFrames[i].distFromPrev, keyFrames[i].tFrom, keyFrames[i].tTo);
// }
// Now we're completely set up; we can move along the length of each waypoint at 100 ms intervals
@@ -398,7 +398,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
cM = keyFrames[i].node->mapid;
}
// sLog.outString("T: %d, D: %f, x: %f, y: %f, z: %f", t, d, newX, newY, newZ);
// sLog->outString("T: %d, D: %f, x: %f, y: %f, z: %f", t, d, newX, newY, newZ);
WayPoint pos(keyFrames[i].node->mapid, newX, newY, newZ, teleport, 0);
if (teleport)
m_WayPoints[t] = pos;
@@ -447,7 +447,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
WayPoint pos(keyFrames[i + 1].node->mapid, keyFrames[i + 1].node->x, keyFrames[i + 1].node->y, keyFrames[i + 1].node->z, teleport,
0, keyFrames[i + 1].node->arrivalEventID, keyFrames[i + 1].node->departureEventID);
// sLog.outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport);
// sLog->outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport);
/*
if (keyFrames[i+1].delay > 5)
pos.delayed = true;
@@ -456,12 +456,12 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
m_WayPoints[t] = pos;
t += keyFrames[i + 1].node->delay * 1000;
// sLog.outString("------");
// sLog->outString("------");
}
uint32 timer = t;
// sLog.outDetail(" Generated %lu waypoints, total time %u.", (unsigned long)m_WayPoints.size(), timer);
// sLog->outDetail(" Generated %lu waypoints, total time %u.", (unsigned long)m_WayPoints.size(), timer);
m_curr = m_WayPoints.begin();
m_next = GetNextWayPoint();
@@ -520,7 +520,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
bool Transport::AddPassenger(Player* passenger)
{
if (m_passengers.insert(passenger).second)
sLog.outDetail("Player %s boarded transport %s.", passenger->GetName(), GetName());
sLog->outDetail("Player %s boarded transport %s.", passenger->GetName(), GetName());
sScriptMgr->OnAddPassenger(this, passenger);
return true;
@@ -529,7 +529,7 @@ bool Transport::AddPassenger(Player* passenger)
bool Transport::RemovePassenger(Player* passenger)
{
if (m_passengers.erase(passenger))
sLog.outDetail("Player %s removed from transport %s.", passenger->GetName(), GetName());
sLog->outDetail("Player %s removed from transport %s.", passenger->GetName(), GetName());
sScriptMgr->OnRemovePassenger(this, passenger);
return true;
@@ -540,7 +540,7 @@ void Transport::Update(uint32 p_diff)
if(!AI())
{
if (!AIM_Initialize())
sLog.outError("Could not initialize GameObjectAI for Transport");
sLog->outError("Could not initialize GameObjectAI for Transport");
} else
AI()->UpdateAI(p_diff);
@@ -572,11 +572,11 @@ void Transport::Update(uint32 p_diff)
m_nextNodeTime = m_curr->first;
if (m_curr == m_WayPoints.begin() && (sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0)
sLog.outDetail(" ************ BEGIN ************** %s", m_name.c_str());
if (m_curr == m_WayPoints.begin() && (sLog->getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0)
sLog->outDetail(" ************ BEGIN ************** %s", m_name.c_str());
if ((sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0)
sLog.outDetail("%s moved to %d %f %f %f %d", m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
if ((sLog->getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0)
sLog->outDetail("%s moved to %d %f %f %f %d", m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
}
sScriptMgr->OnTransportUpdate(this, p_diff);
@@ -619,7 +619,7 @@ void Transport::DoEventIfAny(WayPointMap::value_type const& node, bool departure
{
if (uint32 eventid = departure ? node.second.departureEventID : node.second.arrivalEventID)
{
sLog.outDebug("Taxi %s event %u of node %u of %s path", departure ? "departure" : "arrival", eventid, node.first, GetName());
sLog->outDebug("Taxi %s event %u of node %u of %s path", departure ? "departure" : "arrival", eventid, node.first, GetName());
GetMap()->ScriptsStart(sEventScripts, eventid, this, this);
EventInform(eventid);
}
@@ -668,7 +668,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y,
if(!pCreature->IsPositionValid())
{
sLog.outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
delete pCreature;
return 0;
}
File diff suppressed because it is too large Load Diff
+9 -9
View File
@@ -129,7 +129,7 @@ void Vehicle::InstallAllAccessories(uint32 entry)
void Vehicle::Uninstall()
{
sLog.outDebug("Vehicle::Uninstall %u", me->GetEntry());
sLog->outDebug("Vehicle::Uninstall %u", me->GetEntry());
for (SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr)
if (Unit *passenger = itr->second.passenger)
if (passenger->HasUnitTypeMask(UNIT_MASK_ACCESSORY))
@@ -143,7 +143,7 @@ void Vehicle::Uninstall()
void Vehicle::Die()
{
sLog.outDebug("Vehicle::Die %u", me->GetEntry());
sLog->outDebug("Vehicle::Die %u", me->GetEntry());
for (SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr)
if (Unit *passenger = itr->second.passenger)
if (passenger->HasUnitTypeMask(UNIT_MASK_ACCESSORY))
@@ -157,7 +157,7 @@ void Vehicle::Die()
void Vehicle::Reset()
{
sLog.outDebug("Vehicle::Reset");
sLog->outDebug("Vehicle::Reset");
if (me->GetTypeId() == TYPEID_PLAYER)
{
if (m_usableSeatNum)
@@ -176,18 +176,18 @@ void Vehicle::Reset()
void Vehicle::RemoveAllPassengers()
{
sLog.outDebug("Vehicle::RemoveAllPassengers");
sLog->outDebug("Vehicle::RemoveAllPassengers");
for (SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr)
if (Unit *passenger = itr->second.passenger)
{
if (passenger->IsVehicle())
passenger->GetVehicleKit()->RemoveAllPassengers();
if (passenger->GetVehicle() != this)
sLog.outCrash("Vehicle %u has invalid passenger %u.", me->GetEntry(), passenger->GetEntry());
sLog->outCrash("Vehicle %u has invalid passenger %u.", me->GetEntry(), passenger->GetEntry());
passenger->ExitVehicle();
if (itr->second.passenger)
{
sLog.outCrash("Vehicle %u cannot remove passenger %u. %u is still on vehicle.", me->GetEntry(), passenger->GetEntry(), itr->second.passenger->GetEntry());
sLog->outCrash("Vehicle %u cannot remove passenger %u. %u is still on vehicle.", me->GetEntry(), passenger->GetEntry(), itr->second.passenger->GetEntry());
itr->second.passenger = NULL;
}
@@ -294,7 +294,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
ASSERT(!seat->second.passenger);
}
sLog.outDebug("Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first);
sLog->outDebug("Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first);
seat->second.passenger = unit;
if (seat->second.seatInfo->IsUsable())
@@ -377,7 +377,7 @@ void Vehicle::RemovePassenger(Unit *unit)
ASSERT(seat != m_Seats.end());
sLog.outDebug("Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first);
sLog->outDebug("Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first);
seat->second.passenger = NULL;
if (seat->second.seatInfo->IsUsable())
@@ -439,7 +439,7 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang)
void Vehicle::Dismiss()
{
sLog.outDebug("Vehicle::Dismiss %u", me->GetEntry());
sLog->outDebug("Vehicle::Dismiss %u", me->GetEntry());
Uninstall();
me->SendObjectDeSpawnAnim(me->GetGUID());
me->CombatStop();