From be034c71ee4591ae288f0122b492f9df1c8ec6f7 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Fri, 22 Jan 2016 13:44:12 -0600 Subject: [PATCH] ifdef added to code not run unless debug --- .../SwgDatabaseServer/src/shared/buffers/LocationBuffer.cpp | 2 ++ .../SwgDatabaseServer/src/shared/buffers/ScriptBuffer.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/game/server/application/SwgDatabaseServer/src/shared/buffers/LocationBuffer.cpp b/game/server/application/SwgDatabaseServer/src/shared/buffers/LocationBuffer.cpp index f10d32a5..187e88dc 100755 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/LocationBuffer.cpp +++ b/game/server/application/SwgDatabaseServer/src/shared/buffers/LocationBuffer.cpp @@ -109,7 +109,9 @@ void LocationBuffer::getLocationList(const NetworkId &objectId, size_t listId, s for (LoadDataType::const_iterator i=m_loadData.find(IndexKey(objectId, listId, 0)); (i!=m_loadData.end()) && (i->first.m_objectId == objectId) && (i->first.m_listId == listId); ++i) { +#ifdef _DEBUG DEBUG_FATAL(i->first.m_index != expectedIndex++,("Programmer bug: location list was not sorted or had gaps in the sequence. Object id %s, list id %i, sequence %i\n",objectId.getValueString().c_str(), listId, i->first.m_index)); +#endif values.push_back(i->second); } diff --git a/game/server/application/SwgDatabaseServer/src/shared/buffers/ScriptBuffer.cpp b/game/server/application/SwgDatabaseServer/src/shared/buffers/ScriptBuffer.cpp index e9959565..4f6131bf 100755 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/ScriptBuffer.cpp +++ b/game/server/application/SwgDatabaseServer/src/shared/buffers/ScriptBuffer.cpp @@ -98,7 +98,9 @@ void ScriptBuffer::getScriptsForObject(const NetworkId &objectId, std::vectorfind(IndexKey(objectId,0)); (i!=m_loadedData->end()) && (i->first.m_objectId==objectId); ++i) { +#ifdef _DEBUG DEBUG_WARNING((i->first.m_index != expectedIndex++), ("Programmer bug: Script buffer was not sorted, or there were gaps in the sequence. ObjectId %s, sequence number %i\n",objectId.getValueString().c_str(),i->first.m_index)); +#endif scripts.push_back(i->second); } }