chore(Core): Code Reduction dealing with Logging, (Cosmetic only). (#8686)

This commit is contained in:
acidmanifesto
2021-10-24 21:33:16 -04:00
committed by GitHub
parent 0247db86d0
commit 0df821cbb0
14 changed files with 80 additions and 80 deletions

View File

@@ -207,7 +207,7 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* source, uint32 soundId)
if (!sSoundEntriesStore.LookupEntry(soundId))
{
LOG_ERROR("entities.unit.ai", "TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: %s)", soundId, source->GetGUID().ToString().c_str());
LOG_ERROR("entities.unit.ai", "Invalid soundId %u used in DoPlaySoundToSet (Source: %s)", soundId, source->GetGUID().ToString().c_str());
return;
}
@@ -368,7 +368,7 @@ void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o
if (Player* player = unit->ToPlayer())
player->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
else
LOG_ERROR("entities.unit.ai", "TSCR: Creature %s Tried to teleport non-player unit %s to x: %f y:%f z: %f o: %f. Aborted.",
LOG_ERROR("entities.unit.ai", "Creature %s Tried to teleport non-player unit %s to x: %f y:%f z: %f o: %f. Aborted.",
me->GetGUID().ToString().c_str(), unit->GetGUID().ToString().c_str(), x, y, z, o);
}

View File

@@ -209,7 +209,7 @@ void npc_escortAI::EnterEvadeMode()
{
AddEscortState(STATE_ESCORT_RETURNING);
ReturnToLastPoint();
LOG_DEBUG("scripts.ai", "TSCR: EscortAI has left combat and is now returning to last point");
LOG_DEBUG("scripts.ai", "EscortAI has left combat and is now returning to last point");
}
else
{
@@ -335,7 +335,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
//Combat start position reached, continue waypoint movement
if (pointId == POINT_LAST_POINT)
{
LOG_DEBUG("scripts.ai", "TSCR: EscortAI has returned to original position before combat");
LOG_DEBUG("scripts.ai", "EscortAI has returned to original position before combat");
me->SetWalk(!m_bIsRunning);
RemoveEscortState(STATE_ESCORT_RETURNING);
@@ -345,7 +345,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
}
else if (pointId == POINT_HOME)
{
LOG_DEBUG("scripts.ai", "TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list.");
LOG_DEBUG("scripts.ai", "EscortAI has returned to original home location and will continue from beginning of waypoint list.");
CurrentWP = WaypointList.begin();
m_uiWPWaitTimer = 1;
@@ -433,14 +433,14 @@ void npc_escortAI::SetRun(bool on)
if (!m_bIsRunning)
me->SetWalk(false);
else
LOG_DEBUG("scripts.ai", "TSCR: EscortAI attempt to set run mode, but is already running.");
LOG_DEBUG("scripts.ai", "EscortAI attempt to set run mode, but is already running.");
}
else
{
if (m_bIsRunning)
me->SetWalk(true);
else
LOG_DEBUG("scripts.ai", "TSCR: EscortAI attempt to set walk mode, but is already walking.");
LOG_DEBUG("scripts.ai", "EscortAI attempt to set walk mode, but is already walking.");
}
m_bIsRunning = on;
@@ -451,13 +451,13 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
{
if (me->GetVictim())
{
LOG_ERROR("entities.unit.ai", "TSCR ERROR: EscortAI (script: %s, creature entry: %u) attempts to Start while in combat", me->GetScriptName().c_str(), me->GetEntry());
LOG_ERROR("entities.unit.ai", "ERROR: EscortAI (script: %s, creature entry: %u) attempts to Start while in combat", me->GetScriptName().c_str(), me->GetEntry());
return;
}
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
LOG_ERROR("entities.unit.ai", "TSCR: EscortAI (script: %s, creature entry: %u) attempts to Start while already escorting", me->GetScriptName().c_str(), me->GetEntry());
LOG_ERROR("entities.unit.ai", "EscortAI (script: %s, creature entry: %u) attempts to Start while already escorting", me->GetScriptName().c_str(), me->GetEntry());
return;
}
@@ -470,7 +470,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
if (WaypointList.empty())
{
LOG_ERROR("sql.sql", "TSCR: EscortAI (script: %s, creature entry: %u) starts with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).",
LOG_ERROR("sql.sql", "EscortAI (script: %s, creature entry: %u) starts with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).",
me->GetScriptName().c_str(), me->GetEntry(), quest ? quest->GetQuestId() : 0);
return;
}
@@ -486,13 +486,13 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
m_bCanReturnToStart = canLoopPath;
if (m_bCanReturnToStart && m_bCanInstantRespawn)
LOG_DEBUG("scripts.ai", "TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
LOG_DEBUG("scripts.ai", "EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MoveIdle();
LOG_DEBUG("scripts.ai", "TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
LOG_DEBUG("scripts.ai", "EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
}
//disable npcflags
@@ -503,7 +503,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
}
LOG_DEBUG("scripts.ai", "TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %s",
LOG_DEBUG("scripts.ai", "EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %s",
uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID.ToString().c_str());
CurrentWP = WaypointList.begin();

View File

@@ -159,7 +159,7 @@ void FollowerAI::EnterEvadeMode()
if (HasFollowState(STATE_FOLLOW_INPROGRESS))
{
LOG_DEBUG("scripts.ai", "TSCR: FollowerAI left combat, returning to CombatStartPosition.");
LOG_DEBUG("scripts.ai", "FollowerAI left combat, returning to CombatStartPosition.");
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
{
@@ -185,7 +185,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff)
{
if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT))
{
LOG_DEBUG("scripts.ai", "TSCR: FollowerAI is set completed, despawns.");
LOG_DEBUG("scripts.ai", "FollowerAI is set completed, despawns.");
me->DespawnOrUnsummon();
return;
}
@@ -196,7 +196,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff)
{
if (HasFollowState(STATE_FOLLOW_RETURNING))
{
LOG_DEBUG("scripts.ai", "TSCR: FollowerAI is returning to leader.");
LOG_DEBUG("scripts.ai", "FollowerAI is returning to leader.");
RemoveFollowState(STATE_FOLLOW_RETURNING);
me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
@@ -225,7 +225,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff)
if (bIsMaxRangeExceeded)
{
LOG_DEBUG("scripts.ai", "TSCR: FollowerAI failed because player/group was to far away or not found");
LOG_DEBUG("scripts.ai", "FollowerAI failed because player/group was to far away or not found");
me->DespawnOrUnsummon();
return;
}
@@ -268,13 +268,13 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
{
if (me->GetVictim())
{
LOG_DEBUG("scripts.ai", "TSCR: FollowerAI attempt to StartFollow while in combat.");
LOG_DEBUG("scripts.ai", "FollowerAI attempt to StartFollow while in combat.");
return;
}
if (HasFollowState(STATE_FOLLOW_INPROGRESS))
{
LOG_DEBUG("entities.unit.ai", "TSCR: FollowerAI attempt to StartFollow while already following.");
LOG_ERROR("entities.unit.ai", "FollowerAI attempt to StartFollow while already following.");
return;
}
@@ -290,7 +290,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
{
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
LOG_DEBUG("scripts.ai", "TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
LOG_DEBUG("scripts.ai", "FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
}
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
@@ -299,7 +299,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
LOG_DEBUG("scripts.ai", "TSCR: FollowerAI start follow %s (%s)", player->GetName().c_str(), m_uiLeaderGUID.ToString().c_str());
LOG_DEBUG("scripts.ai", "FollowerAI start follow %s (%s)", player->GetName().c_str(), m_uiLeaderGUID.ToString().c_str());
}
Player* FollowerAI::GetLeaderForFollower()
@@ -318,7 +318,7 @@ Player* FollowerAI::GetLeaderForFollower()
if (member && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE) && member->IsAlive())
{
LOG_DEBUG("scripts.ai", "TSCR: FollowerAI GetLeader changed and returned new leader.");
LOG_DEBUG("scripts.ai", "FollowerAI GetLeader changed and returned new leader.");
m_uiLeaderGUID = member->GetGUID();
return member;
}
@@ -327,7 +327,7 @@ Player* FollowerAI::GetLeaderForFollower()
}
}
LOG_DEBUG("scripts.ai", "TSCR: FollowerAI GetLeader can not find suitable leader.");
LOG_DEBUG("scripts.ai", "FollowerAI GetLeader can not find suitable leader.");
return nullptr;
}