fix a bit of chatty ai logs

This commit is contained in:
DarthArgus
2016-12-18 04:25:28 +00:00
parent 04be3f253a
commit 263f32fb01
2 changed files with 8 additions and 3 deletions
@@ -52,7 +52,13 @@ void AiLogManager::setLogging(NetworkId const & networkId, bool const enabled)
// ----------------------------------------------------------------------
bool AiLogManager::isLogging(NetworkId const & networkId)
{
return ConfigServerGame::isAiLoggingEnabled() || (s_aiList.find(networkId) != s_aiList.end());
bool result = (ConfigServerGame::isAiLoggingEnabled() && (s_aiList.find(networkId) != s_aiList.end()));
if (!result) {
s_aiList.erase(networkId);
}
return result;
}
// ======================================================================
@@ -167,8 +167,7 @@ AICreatureController::~AICreatureController()
if (owner != nullptr && owner->isAuthoritative() && !getHibernate() && m_hibernationDelay.get() > 0 && m_hibernationTimer.get() > 0)
ObjectTracker::removeDelayedHibernatingAI();
if ( (owner != nullptr)
&& AiLogManager::isLogging(owner->getNetworkId()))
if ((owner != nullptr) && AiLogManager::isLogging(owner->getNetworkId()))
{
AiLogManager::setLogging(owner->getNetworkId(), false);
}