From 29fc46aa0011e78b850f27e2fd71e3593eaf79eb Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 5 May 2024 18:21:21 +0800 Subject: [PATCH] [saco] Implement and match `GetInvalidModelInfoCount()` --- saco/game/util.cpp | 14 ++++++++++++++ saco/game/util.h | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/saco/game/util.cpp b/saco/game/util.cpp index 8d71679..0c53b32 100644 --- a/saco/game/util.cpp +++ b/saco/game/util.cpp @@ -1197,6 +1197,20 @@ void ReplaceBuildingModel(ENTITY_TYPE *pEntity, int iModelID) _asm call edx } +//----------------------------------------------------------- + +int GetInvalidModelInfoCount() +{ + DWORD *dwModelInfos = (DWORD *)0xA9C068; + int iCount = 0; + for(int i = 0; i != 19000; i++) + { + if(dwModelInfos[i] == NULL) + iCount++; + } + return iCount; +} + //----------------------------------------------------------- // Translate Weapon model ID into actual weapon ID. diff --git a/saco/game/util.h b/saco/game/util.h index 20d37e7..15d4f20 100644 --- a/saco/game/util.h +++ b/saco/game/util.h @@ -40,4 +40,4 @@ DUMMY_TYPE * GamePool_GetDummy(); OBJECT_TYPE * GamePool_GetObject(); void ReplaceBuildingModel(ENTITY_TYPE *pEntity, int iModelID); - +int GetInvalidModelInfoCount();