diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderWeapon.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderWeapon.cpp index e6fa3547..268f9b58 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderWeapon.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderWeapon.cpp @@ -62,7 +62,7 @@ namespace _NODISCARD bool ConvertBounceSounds(const cspField_t& field, const std::string& value) const { - auto*** bounceSound = reinterpret_cast(reinterpret_cast(m_structure) + field.iOffset); + auto** bounceSound = reinterpret_cast(reinterpret_cast(m_structure) + field.iOffset); if (value.empty()) { *bounceSound = nullptr; @@ -70,12 +70,15 @@ namespace } assert(std::extent_v == SURF_TYPE_NUM); - *bounceSound = static_cast(m_memory->Alloc(sizeof(const char*) * SURF_TYPE_NUM)); + *bounceSound = static_cast(m_memory->Alloc(sizeof(SndAliasCustom) * SURF_TYPE_NUM)); for (auto i = 0u; i < SURF_TYPE_NUM; i++) { const auto currentBounceSound = value + bounceSoundSuffixes[i]; - (*bounceSound)[i] = m_memory->Dup(currentBounceSound.c_str()); + + (*bounceSound)[i].name = static_cast(m_memory->Alloc(sizeof(snd_alias_list_name))); + (*bounceSound)[i].name->soundName = m_memory->Dup(currentBounceSound.c_str()); } + return true; }