Another zones::version specific to the map

This commit is contained in:
Louvenarde 2021-07-28 18:49:39 +02:00
parent 9de63a3772
commit 2dd703c037
3 changed files with 23 additions and 13 deletions

View File

@ -390,20 +390,24 @@ namespace Components
bool QuickPatch::IsDynClassnameStub(char* a1)
{
for (auto i = 0; i < Game::spawnVars->numSpawnVars; i++)
{
char** kvPair = Game::spawnVars->spawnVars[i];
auto key = kvPair[0];
auto val = kvPair[1];
auto version = Zones::GetEntitiesZoneVersion();
bool isSpecOps = strncmp(key, "script_specialops", 17) == 0;
bool isSpecOpsOnly = val[0] == '1' && val[1] == '\0';
if (isSpecOps && isSpecOpsOnly)
if (version >= VERSION_LATEST_CODO) {
for (auto i = 0; i < Game::spawnVars->numSpawnVars; i++)
{
// This will prevent spawning of any entity that contains "script_specialops: '1'"
// It removes extra hitboxes / meshes on 461+ CODO multiplayer maps
return true;
char** kvPair = Game::spawnVars->spawnVars[i];
auto key = kvPair[0];
auto val = kvPair[1];
bool isSpecOps = strncmp(key, "script_specialops", 17) == 0;
bool isSpecOpsOnly = val[0] == '1' && val[1] == '\0';
if (isSpecOps && isSpecOpsOnly)
{
// This will prevent spawning of any entity that contains "script_specialops: '1'"
// It removes extra hitboxes / meshes on 461+ CODO multiplayer maps
return true;
}
}
}

View File

@ -4,6 +4,7 @@
namespace Components
{
int Zones::ZoneVersion;
int Zones::EntitiesVersion;
int Zones::FxEffectIndex;
char* Zones::FxEffectStrings[64];
@ -2561,6 +2562,8 @@ namespace Components
int Zones::LoadMapEnts(bool atStreamStart, Game::MapEnts* buffer, int size)
{
EntitiesVersion = Zones::Version();
if (Zones::Version() >= 446)
{
size /= 44;

View File

@ -24,9 +24,12 @@ namespace Components
static int Version() { return Zones::ZoneVersion; };
static int GetEntitiesZoneVersion() { return Zones::EntitiesVersion; };
private:
static int ZoneVersion;
static int EntitiesVersion;
static int FxEffectIndex;
static char* FxEffectStrings[64];