diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 615e6f05..dac00a9b 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -1,5 +1,5 @@ ;sfall configuration settings -;v4.4.2.1 +;v4.4.3 [Main] ;Set to 1 to enable the built-in High Resolution Patch mode that is similar to the hi-res patch by Mash diff --git a/sfall/Modules/Message.cpp b/sfall/Modules/Message.cpp index 6d61e843..4517aeb0 100644 --- a/sfall/Modules/Message.cpp +++ b/sfall/Modules/Message.cpp @@ -21,6 +21,7 @@ #include "..\main.h" #include "..\FalloutEngine\Fallout2.h" +#include "..\Utils.h" #include "LoadGameHook.h" #include "Message.h" @@ -63,6 +64,7 @@ const char* Message::GameLanguage() { ExtraGameMessageListsMap Message::gExtraGameMsgLists; static std::vector msgFileList; +static std::unordered_map addedExtraMsgFiles; static long msgNumCounter = 0x3000; @@ -193,6 +195,11 @@ long Message::AddExtraMsgFile(const char* msgName, long msgNumber) { std::string path("game\\"); path += msgName; + ToLowerCase(path); + + const auto &msgIt = addedExtraMsgFiles.find(path.c_str()); + if (msgIt != addedExtraMsgFiles.cend()) return msgIt->second; // file has already been added by func + fo::MessageList* list = new fo::MessageList(); if (!fo::func::message_load(list, path.c_str())) { // change current language folder @@ -204,6 +211,7 @@ long Message::AddExtraMsgFile(const char* msgName, long msgNumber) { } if (msgNumber == 0) msgNumber = msgNumCounter++; Message::gExtraGameMsgLists.emplace(msgNumber, list); + addedExtraMsgFiles.emplace(path, msgNumber); return msgNumber; } @@ -216,6 +224,7 @@ static void ClearScriptAddedExtraGameMsg() { // C++11 ++it; } } + addedExtraMsgFiles.clear(); msgNumCounter = 0x3000; heroIsFemale = -1; } diff --git a/sfall/Modules/SubModules/ObjectName.cpp b/sfall/Modules/SubModules/ObjectName.cpp index e75070a2..3a25d750 100644 --- a/sfall/Modules/SubModules/ObjectName.cpp +++ b/sfall/Modules/SubModules/ObjectName.cpp @@ -40,7 +40,7 @@ void ObjectName::SetName(long sid, const char* name) { const char* __stdcall ObjectName::GetName(fo::GameObject* object) { if (!overrideScrName.empty()) { - auto& name = overrideScrName.find(object->scriptId); + const auto &name = overrideScrName.find(object->scriptId); if (name != overrideScrName.cend()) { return (name->second.length() > 0) ? name->second.c_str() diff --git a/sfall/Modules/Worldmap.cpp b/sfall/Modules/Worldmap.cpp index e60eeb0c..c4bcb73c 100644 --- a/sfall/Modules/Worldmap.cpp +++ b/sfall/Modules/Worldmap.cpp @@ -46,10 +46,10 @@ struct levelRest { }; #pragma pack(pop) -std::unordered_map mapRestInfo; +static std::unordered_map mapRestInfo; -std::vector> wmTerrainTypeNames; // pair first: x + y * number of horizontal sub-tiles -std::unordered_map wmAreaHotSpotTitle; +static std::vector> wmTerrainTypeNames; // pair first: x + y * number of horizontal sub-tiles +static std::unordered_map wmAreaHotSpotTitle; static bool restMap; static bool restMode; diff --git a/sfall/version.h b/sfall/version.h index 25ea8dc3..f9c05d06 100644 --- a/sfall/version.h +++ b/sfall/version.h @@ -24,7 +24,7 @@ #define VERSION_MAJOR 4 #define VERSION_MINOR 4 -#define VERSION_BUILD 2 -#define VERSION_REV 1 +#define VERSION_BUILD 3 +#define VERSION_REV 0 -#define VERSION_STRING "4.4.2.1" +#define VERSION_STRING "4.4.3"