This commit is contained in:
Aaron Kimbre 2022-04-12 18:05:22 -05:00
parent 6b44936c68
commit 40d396c7e2

View File

@ -1931,18 +1931,14 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
} }
bool SlashCommandHandler::CheckIfAccessibleZone(const unsigned int zoneID) { bool SlashCommandHandler::CheckIfAccessibleZone(const unsigned int zoneID) {
//We're gonna go ahead and presume we've got the db loaded already: //We're gonna go ahead and presume we've got the db loaded already:
CDZoneTableTable * zoneTable = CDClientManager::Instance()->GetTable<CDZoneTableTable>("ZoneTable"); CDZoneTableTable * zoneTable = CDClientManager::Instance()->GetTable<CDZoneTableTable>("ZoneTable");
const CDZoneTable* zone = zoneTable->Query(zoneID); const CDZoneTable* zone = zoneTable->Query(zoneID);
if (zone != nullptr) { if (zone != nullptr) {
std::string zonePath = "./res/maps/" + zone->zoneName; std::string zonePath = "./res/maps/" + zone->zoneName;
std::transform(zonePath.begin(), zonePath.end(), zonePath.begin(), ::tolower); std::transform(zonePath.begin(), zonePath.end(), zonePath.begin(), ::tolower);
std::ifstream f(zonePath.c_str()); std::ifstream f(zonePath.c_str());
if (f.good()){ return f.good()
return true;
} else {
return false;
}
} else { } else {
return false; return false;
} }