Revert "Try to load from original zone path before a lowercased one"

This commit is contained in:
Avery 2021-12-07 00:25:19 -08:00 committed by GitHub
parent 994382b801
commit 595afc4a93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,15 +42,7 @@ void Zone::LoadZoneIntoMemory() {
m_ZonePath = m_ZoneFilePath.substr(0, m_ZoneFilePath.rfind('/') + 1);
if (m_ZoneFilePath == "ERR") return;
// try to open with regular cased path first
std::ifstream file(m_ZoneFilePath, std::ios::binary);
if (!file) {
// if that fails try the path in lowercase
std::transform(m_ZoneFilePath.begin(), m_ZoneFilePath.end(), m_ZoneFilePath.begin(), ::tolower);
file.open(m_ZoneFilePath, std::ios::binary);
}
if (file) {
BinaryIO::BinaryRead(file, m_ZoneFileFormatVersion);
@ -180,6 +172,7 @@ std::string Zone::GetFilePathForZoneID() {
const CDZoneTable* zone = zoneTable->Query(this->GetZoneID().GetMapID());
if (zone != nullptr) {
std::string toReturn = "./res/maps/" + zone->zoneName;
std::transform(toReturn.begin(), toReturn.end(), toReturn.begin(), ::tolower);
return toReturn;
}