Hello
I added Challenge System which I find on github, but I got some compile errors:
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(746): error C2653: 'BattlegroundSet' : is not a class or namespace name
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(746): error C2065: 'iterator' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(746): error C2146: syntax error : missing ';' before identifier 'itr'
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(746): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(746): error C2065: 'next' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(749): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(749): error C2065: 'm_Battlegrounds' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(749): error C2228: left of '.begin' must have class/struct/union
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(751): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(751): error C2065: 'm_Battlegrounds' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(751): error C2228: left of '.end' must have class/struct/union
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(752): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(753): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(753): error C2065: 'm_Battlegrounds' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(753): error C2228: left of '.end' must have class/struct/union
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(753): error C2065: 'next' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(755): error C2065: 'next' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(755): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(756): error C2065: 'next' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(757): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(757): error C2227: left of '->second' must point to class/struct/union/generic type
6> type is 'unknown-type'
Here is code:
I added Challenge System which I find on github, but I got some compile errors:
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(746): error C2653: 'BattlegroundSet' : is not a class or namespace name
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(746): error C2065: 'iterator' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(746): error C2146: syntax error : missing ';' before identifier 'itr'
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(746): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(746): error C2065: 'next' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(749): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(749): error C2065: 'm_Battlegrounds' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(749): error C2228: left of '.begin' must have class/struct/union
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(751): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(751): error C2065: 'm_Battlegrounds' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(751): error C2228: left of '.end' must have class/struct/union
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(752): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(753): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(753): error C2065: 'm_Battlegrounds' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(753): error C2228: left of '.end' must have class/struct/union
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(753): error C2065: 'next' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(755): error C2065: 'next' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(755): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(756): error C2065: 'next' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(757): error C2065: 'itr' : undeclared identifier
6>C:\Users\Desktop\TrinityCore\src\server\game\Battlegrounds\BattlegroundMgr.cpp(757): error C2227: left of '->second' must point to class/struct/union/generic type
6> type is 'unknown-type'
Here is code:
Code:
bool BattlegroundMgr::HasBattleground(Battleground *_bg)
{
BattlegroundSet::iterator itr, next;
for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; ++i)
{
itr = m_Battlegrounds[i].begin();
// skip updating battleground template
if (itr != m_Battlegrounds[i].end())
++itr;
for (; itr != m_Battlegrounds[i].end(); itr = next)
{
next = itr;
++next;
Battleground* bg = itr->second;
if (bg == _bg)
return true;
}
}
return false;
}