mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
Merge pull request #85 from DarkflameUniverse/revert-44-patch/zone_path_casing
Revert "Try to load from original zone path before a lowercased one"
This commit is contained in:
commit
17e4f2536b
@ -42,15 +42,7 @@ void Zone::LoadZoneIntoMemory() {
|
|||||||
m_ZonePath = m_ZoneFilePath.substr(0, m_ZoneFilePath.rfind('/') + 1);
|
m_ZonePath = m_ZoneFilePath.substr(0, m_ZoneFilePath.rfind('/') + 1);
|
||||||
if (m_ZoneFilePath == "ERR") return;
|
if (m_ZoneFilePath == "ERR") return;
|
||||||
|
|
||||||
// try to open with regular cased path first
|
|
||||||
std::ifstream file(m_ZoneFilePath, std::ios::binary);
|
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) {
|
if (file) {
|
||||||
BinaryIO::BinaryRead(file, m_ZoneFileFormatVersion);
|
BinaryIO::BinaryRead(file, m_ZoneFileFormatVersion);
|
||||||
|
|
||||||
@ -179,7 +171,8 @@ std::string Zone::GetFilePathForZoneID() {
|
|||||||
CDZoneTableTable * zoneTable = CDClientManager::Instance()->GetTable<CDZoneTableTable>("ZoneTable");
|
CDZoneTableTable * zoneTable = CDClientManager::Instance()->GetTable<CDZoneTableTable>("ZoneTable");
|
||||||
const CDZoneTable* zone = zoneTable->Query(this->GetZoneID().GetMapID());
|
const CDZoneTable* zone = zoneTable->Query(this->GetZoneID().GetMapID());
|
||||||
if (zone != nullptr) {
|
if (zone != nullptr) {
|
||||||
std::string toReturn = "./res/maps/" + zone->zoneName;
|
std::string toReturn = "./res/maps/" + zone->zoneName;
|
||||||
|
std::transform(toReturn.begin(), toReturn.end(), toReturn.begin(), ::tolower);
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user