Fix spmap handling

This commit is contained in:
momo5502 2016-10-31 18:16:15 +01:00
parent 4f4d4855e6
commit 37976a4f39
3 changed files with 9 additions and 4 deletions

View File

@ -179,6 +179,11 @@ namespace Components
_snprintf_s(buffer, size, size, format, mapname);
}
void Maps::HandleAsSPMap()
{
Maps::IsSPMap = true;
}
void Maps::AddDependency(std::string expression, std::string zone)
{
// Test expression before adding it

View File

@ -10,7 +10,7 @@ namespace Components
const char* GetName() { return "Maps"; };
#endif
static void HandleAsSPMap() { IsSPMap = true; }
static void HandleAsSPMap();
static void AddDependency(std::string expression, std::string zone);
static std::pair<std::string, std::string> GetTeamsForMap(std::string map);

View File

@ -1286,10 +1286,12 @@ namespace Components
{
AssetHandler::ClearRelocations();
bool patch = (version >= VERSION_ALPHA2);
if (patch) Maps::HandleAsSPMap();
if (Zones::ZoneVersion == version) return;
Zones::ZoneVersion = version;
bool patch = (version >= VERSION_ALPHA2);
if (Zones::ZoneVersion == VERSION_ALPHA2 || Zones::ZoneVersion == VERSION_ALPHA3 || Zones::ZoneVersion == VERSION_ALPHA3_DEC || Zones::ZoneVersion == XFILE_VERSION || Zones::ZoneVersion >= 332)
{
Utils::Hook::Set<DWORD>(0x4158F4, version);
@ -1344,8 +1346,6 @@ namespace Components
if (patch)
{
Maps::HandleAsSPMap();
Zones::LoadFxElemDefArrayHook.Install();
Zones::LoadFxElemDefHook.Install();