From e437d89d4fbea0319a2298ca727c09e6b93f5240 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sat, 22 Nov 2025 13:35:16 -0600 Subject: [PATCH] feat(sound): add SI2::GetSoundKitDef --- src/sound/SI2.cpp | 8 ++++++++ src/sound/SI2.hpp | 1 + 2 files changed, 9 insertions(+) diff --git a/src/sound/SI2.cpp b/src/sound/SI2.cpp index b3bd4ce..7bd8a56 100644 --- a/src/sound/SI2.cpp +++ b/src/sound/SI2.cpp @@ -9,6 +9,14 @@ TSGrowableArray SI2::s_SoundKitDefs; TSHashTable SI2::s_SoundKitLookupTable; +SOUNDKITDEF* SI2::GetSoundKitDef(int32_t id) { + if (id >= SI2::s_SoundKitDefs.Count() || id <= 0) { + return nullptr; + } + + return SI2::s_SoundKitDefs[id]; +} + int32_t SI2::Init(int32_t a1) { // TODO // if (CmdLineGetBool(26)) { diff --git a/src/sound/SI2.hpp b/src/sound/SI2.hpp index 3eb6ae9..9c78edd 100644 --- a/src/sound/SI2.hpp +++ b/src/sound/SI2.hpp @@ -19,6 +19,7 @@ class SI2 { static TSHashTable s_SoundKitLookupTable; // Static functions + static SOUNDKITDEF* GetSoundKitDef(int32_t id); static int32_t Init(int32_t a1); static void InitSoundKitDefs(); static void InitSoundKitGroups();