Skip to content

Commit c37a6ca

Browse files
committed
Fix Legacy Mod Support
Add support for common_zombie_patch_override
1 parent 79abc2b commit c37a6ca

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

components/game_mod/common.cpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ void Com_ToolError(int channel, const char* fmt, ...)
5252

5353
void __cdecl Com_LoadCommonFastFile()
5454
{
55-
XZoneInfo zoneInfo[2];
55+
dvar_s** fs_gameDirVar = (dvar_s**)0x025FADE8;
56+
57+
XZoneInfo zoneInfo[4];
5658
int zoneCount = 0;
5759

5860
DB_ResetZoneSize(0);
@@ -81,6 +83,16 @@ void __cdecl Com_LoadCommonFastFile()
8183
zoneInfo[zoneCount].name = "common_zombie";
8284
zoneInfo[zoneCount].allocFlags = 0x100;
8385
zoneInfo[zoneCount++].freeFlags = 0;
86+
87+
if ((*fs_gameDirVar) != NULL && (*fs_gameDirVar)->current.string[0] != NULL)
88+
{
89+
if (DB_IsZoneLoaded("common_zombie_patch_override"))
90+
return;
91+
92+
zoneInfo[zoneCount].name = "common_zombie_patch_override";
93+
zoneInfo[zoneCount].allocFlags = 0x100;
94+
zoneInfo[zoneCount++].freeFlags = 0;
95+
}
8496
}
8597

8698
if (!zombiemode->current.enabled)
@@ -91,6 +103,19 @@ void __cdecl Com_LoadCommonFastFile()
91103
zoneInfo[zoneCount].name = "common";
92104
zoneInfo[zoneCount].allocFlags = 0x100;
93105
zoneInfo[zoneCount++].freeFlags = 0;
106+
107+
//
108+
// No override is needed for common_patch because common_patch doesn't exist in the vanilla game
109+
//
110+
/*if ((*fs_gameDirVar) != NULL && (*fs_gameDirVar)->current.string[0] != NULL)
111+
{
112+
if (DB_IsZoneLoaded("common_patch_override"))
113+
return;
114+
115+
zoneInfo[zoneCount].name = "common_patch_override";
116+
zoneInfo[zoneCount].allocFlags = 0x100;
117+
zoneInfo[zoneCount++].freeFlags = 0;
118+
}*/
94119
}
95120

96121
DB_LoadXAssets(zoneInfo, zoneCount, 0);

0 commit comments

Comments
 (0)