diff --git a/Source/Contents/TownInfoMgr.cpp b/Source/Contents/TownInfoMgr.cpp index 51fc9944c..60da998e8 100644 --- a/Source/Contents/TownInfoMgr.cpp +++ b/Source/Contents/TownInfoMgr.cpp @@ -140,11 +140,15 @@ TownInfo CTownInfoMgr::GetTownInfo(std::string mapName, unsigned int index) { } std::map>::iterator it = this->m_towns.find(key); - if (it != this->m_towns.end() && index < it->second.size()) { - return it->second[index]; + if (it == this->m_towns.end()) { + return TownInfo(); } - return TownInfo(); + if (index >= it->second.size()) { + return TownInfo(); + } + + return it->second[index]; } // OFFSET: 0x00AE33A0