Run clang-format

This commit is contained in:
Yunfan Li
2024-08-04 10:23:36 +08:00
parent 44da167492
commit 53611c9040
835 changed files with 35085 additions and 31861 deletions

View File

@@ -1,8 +1,10 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "StuckTriggers.h"
#include "CellImpl.h"
#include "PathGenerator.h"
#include "Playerbots.h"
@@ -17,12 +19,14 @@ bool MoveStuckTrigger::IsActive()
WorldPosition botPos(bot);
LogCalculatedValue<WorldPosition>* posVal = dynamic_cast<LogCalculatedValue<WorldPosition>*>(context->GetUntypedValue("current position"));
LogCalculatedValue<WorldPosition>* posVal =
dynamic_cast<LogCalculatedValue<WorldPosition>*>(context->GetUntypedValue("current position"));
if (posVal->LastChangeDelay() > 5 * MINUTE)
{
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for {} seconds",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
// bot->GetName(), posVal->LastChangeDelay());
return true;
}
@@ -45,7 +49,8 @@ bool MoveStuckTrigger::IsActive()
if (longLog)
{
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for 10mins",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
// bot->GetName(), posVal->LastChangeDelay());
}
return longLog;
@@ -68,7 +73,8 @@ bool MoveLongStuckTrigger::IsActive()
if (grid.x_coord < 0 || grid.x_coord >= MAX_NUMBER_OF_GRIDS)
{
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in grid {},{} on map {}",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
// bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
return true;
}
@@ -76,30 +82,36 @@ bool MoveLongStuckTrigger::IsActive()
if (grid.y_coord < 0 || grid.y_coord >= MAX_NUMBER_OF_GRIDS)
{
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in grid {},{} on map {}",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
// bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
return true;
}
if (cell.GridX() > 0 && cell.GridY() > 0 && !MMAP::MMapFactory::createOrGetMMapMgr()->loadMap(botPos.getMapId(), cell.GridX(), cell.GridY()))
if (cell.GridX() > 0 && cell.GridY() > 0 &&
!MMAP::MMapFactory::createOrGetMMapMgr()->loadMap(botPos.getMapId(), cell.GridX(), cell.GridY()))
{
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in unloaded grid {},{} on map {}",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
// bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
return true;
}
LogCalculatedValue<WorldPosition>* posVal = dynamic_cast<LogCalculatedValue<WorldPosition>*>(context->GetUntypedValue("current position"));
LogCalculatedValue<WorldPosition>* posVal =
dynamic_cast<LogCalculatedValue<WorldPosition>*>(context->GetUntypedValue("current position"));
if (posVal->LastChangeDelay() > 10 * MINUTE)
{
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for {} seconds",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
// bot->GetName(), posVal->LastChangeDelay());
return true;
}
MemoryCalculatedValue<uint32>* expVal = dynamic_cast<MemoryCalculatedValue<uint32>*>(context->GetUntypedValue("experience"));
MemoryCalculatedValue<uint32>* expVal =
dynamic_cast<MemoryCalculatedValue<uint32>*>(context->GetUntypedValue("experience"));
if (expVal->LastChangeDelay() < 15 * MINUTE)
return false;
@@ -122,7 +134,8 @@ bool MoveLongStuckTrigger::IsActive()
if (longLog)
{
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for 15mins",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
// bot->GetName(), posVal->LastChangeDelay());
}
return longLog;
@@ -141,12 +154,14 @@ bool CombatStuckTrigger::IsActive()
WorldPosition botPos(bot);
MemoryCalculatedValue<bool>* combatVal = dynamic_cast<MemoryCalculatedValue<bool>*>(context->GetUntypedValue("combat::self target"));
MemoryCalculatedValue<bool>* combatVal =
dynamic_cast<MemoryCalculatedValue<bool>*>(context->GetUntypedValue("combat::self target"));
if (combatVal->LastChangeDelay() > 5 * MINUTE)
{
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in combat for {} seconds",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
// bot->GetName(), posVal->LastChangeDelay());
return true;
}
@@ -167,12 +182,14 @@ bool CombatLongStuckTrigger::IsActive()
WorldPosition botPos(bot);
MemoryCalculatedValue<bool>* combatVal = dynamic_cast<MemoryCalculatedValue<bool>*>(context->GetUntypedValue("combat::self target"));
MemoryCalculatedValue<bool>* combatVal =
dynamic_cast<MemoryCalculatedValue<bool>*>(context->GetUntypedValue("combat::self target"));
if (combatVal->LastChangeDelay() > 15 * MINUTE)
{
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in combat for {} seconds",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
// bot->GetName(), posVal->LastChangeDelay());
return true;
}