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,6 +390,9 @@ namespace Components
bool QuickPatch::IsDynClassnameStub(char* a1)
{
auto version = Zones::GetEntitiesZoneVersion();
if (version >= VERSION_LATEST_CODO) {
for (auto i = 0; i < Game::spawnVars->numSpawnVars; i++)
{
char** kvPair = Game::spawnVars->spawnVars[i];
@ -406,6 +409,7 @@ namespace Components
return true;
}
}
}
// Passthrough to the game's own IsDynClassname
return Utils::Hook::Call<bool(char*)>(0x444810)(a1);

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];