From d57dfa5d4a5b422e8ddc770c5c9325dcb468ff95 Mon Sep 17 00:00:00 2001 From: GameChaos Date: Tue, 29 Oct 2024 20:54:02 +0200 Subject: [PATCH] Add back apiVersionLoaded --- src/kz/mappingapi/kz_mappingapi.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/kz/mappingapi/kz_mappingapi.cpp b/src/kz/mappingapi/kz_mappingapi.cpp index 3cc76187..d096a0fe 100644 --- a/src/kz/mappingapi/kz_mappingapi.cpp +++ b/src/kz/mappingapi/kz_mappingapi.cpp @@ -27,6 +27,7 @@ static_global struct { CUtlVectorFixed courseDescriptors; i32 mapApiVersion; + bool apiVersionLoaded; bool fatalFailure; CUtlVectorFixed triggers; @@ -477,11 +478,16 @@ void KZ::mapapi::Init() void KZ::mapapi::OnCreateLoadingSpawnGroupHook(const CUtlVector *pKeyValues) { - g_mappingApi = {}; if (!pKeyValues) { return; } + + if (g_mappingApi.apiVersionLoaded) + { + return; + } + for (i32 i = 0; i < pKeyValues->Count(); i++) { auto ekv = (*pKeyValues)[i]; @@ -494,6 +500,7 @@ void KZ::mapapi::OnCreateLoadingSpawnGroupHook(const CUtlVectorGetInt("timer_mapping_api_version", KZ_NO_MAPAPI_VERSION); // NOTE(GameChaos): When a new mapping api version comes out, this will change // for backwards compatibility.