Fixed and optimized EXTRA_LOGS code

about 1700 lines of code manually checked
This commit is contained in:
Yehonal
2017-09-25 15:09:21 +02:00
parent e687d223ff
commit 7a0e6e7da2
17 changed files with 511 additions and 569 deletions

View File

@@ -280,8 +280,8 @@ void VehicleAI::OnCharmed(bool apply)
void VehicleAI::LoadConditions()
{
conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE, me->GetEntry());
//if (!conditions.empty())
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
if (!conditions.empty())
sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleAI::LoadConditions: loaded %u conditions", uint32(conditions.size()));
#endif
}

View File

@@ -82,11 +82,9 @@ namespace FactorySelector
}
}
// select NullCreatureAI if not another cases
// xinef: unused
// ainame = (ai_factory == NULL) ? "NullCreatureAI" : ai_factory->key();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
// select NullCreatureAI if not another cases
ainame = (ai_factory == NULL) ? "NullCreatureAI" : ai_factory->key();
sLog->outDebug(LOG_FILTER_TSCR, "Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str());
#endif
return (ai_factory == NULL ? new NullCreatureAI(creature) : ai_factory->Create(creature));
@@ -133,10 +131,8 @@ namespace FactorySelector
//future goAI types go here
// xinef: unused
std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key();
sLog->outDebug(LOG_FILTER_TSCR, "GameObject %u used AI is %s.", go->GetGUIDLow(), ainame.c_str());
#endif

View File

@@ -438,8 +438,8 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
m_bCanInstantRespawn = instantRespawn;
m_bCanReturnToStart = canLoopPath;
//if (m_bCanReturnToStart && m_bCanInstantRespawn)
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
if (m_bCanReturnToStart && m_bCanInstantRespawn)
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
#endif

View File

@@ -4103,9 +4103,7 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
if (obj)
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry());
#endif
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
if (at)
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id);
#endif

View File

@@ -1634,8 +1634,8 @@ class SmartAIMgr
return mEventMap[uint32(type)][entry];
else
{
//if (entry > 0)//first search is for guid (negative), do not drop error if not found
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
if (entry > 0) //first search is for guid (negative), do not drop error if not found
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartAIMgr::GetScript: Could not load Script for Entry %d ScriptType %u.", entry, uint32(type));
#endif
return temp;