Skip to content

Commit

Permalink
Fix Legacy Mod Support
Browse files Browse the repository at this point in the history
Add support for common_zombie_patch_override
  • Loading branch information
SE2Dev committed Sep 26, 2016
1 parent c6b48c4 commit 96564f0
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion components/game_mod/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ void Com_ToolError(int channel, const char* fmt, ...)

void __cdecl Com_LoadCommonFastFile()
{
XZoneInfo zoneInfo[2];
dvar_s** fs_gameDirVar = (dvar_s**)0x025FADE8;

XZoneInfo zoneInfo[4];
int zoneCount = 0;

DB_ResetZoneSize(0);
Expand Down Expand Up @@ -81,6 +83,16 @@ void __cdecl Com_LoadCommonFastFile()
zoneInfo[zoneCount].name = "common_zombie";
zoneInfo[zoneCount].allocFlags = 0x100;
zoneInfo[zoneCount++].freeFlags = 0;

if ((*fs_gameDirVar) != NULL && (*fs_gameDirVar)->current.string[0] != NULL)
{
if (DB_IsZoneLoaded("common_zombie_patch_override"))
return;

zoneInfo[zoneCount].name = "common_zombie_patch_override";
zoneInfo[zoneCount].allocFlags = 0x100;
zoneInfo[zoneCount++].freeFlags = 0;
}
}

if (!zombiemode->current.enabled)
Expand All @@ -91,6 +103,19 @@ void __cdecl Com_LoadCommonFastFile()
zoneInfo[zoneCount].name = "common";
zoneInfo[zoneCount].allocFlags = 0x100;
zoneInfo[zoneCount++].freeFlags = 0;

//
// No override is needed for common_patch because common_patch doesn't exist in the vanilla game
//
/*if ((*fs_gameDirVar) != NULL && (*fs_gameDirVar)->current.string[0] != NULL)
{
if (DB_IsZoneLoaded("common_patch_override"))
return;
zoneInfo[zoneCount].name = "common_patch_override";
zoneInfo[zoneCount].allocFlags = 0x100;
zoneInfo[zoneCount++].freeFlags = 0;
}*/
}

DB_LoadXAssets(zoneInfo, zoneCount, 0);
Expand Down

0 comments on commit 96564f0

Please sign in to comment.