diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp index 460e6d2511..15dfaaadd4 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp @@ -225,6 +225,11 @@ void WeaponSet::xfer( Xfer *xfer ) if (tt == nullptr) throw INI_INVALID_DATA; + // TheSuperHackers @fix bobtista 27/01/2026 findTemplate returns the base template, but Object + // uses getFinalOverride() in its constructor. We must do the same here so m_curWeaponTemplateSet + // points to the same ThingTemplate's weapon sets, avoiding unnecessary reallocation in updateWeaponSet. + tt = static_cast(tt->getFinalOverride()); + m_curWeaponTemplateSet = tt->findWeaponTemplateSet(wsFlags); if (m_curWeaponTemplateSet == nullptr) throw INI_INVALID_DATA; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp index 96b6da59e4..9fbaaa65cd 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp @@ -232,6 +232,11 @@ void WeaponSet::xfer( Xfer *xfer ) if (tt == nullptr) throw INI_INVALID_DATA; + // TheSuperHackers @fix bobtista 27/01/2026 findTemplate returns the base template, but Object + // uses getFinalOverride() in its constructor. We must do the same here so m_curWeaponTemplateSet + // points to the same ThingTemplate's weapon sets, avoiding unnecessary reallocation in updateWeaponSet. + tt = static_cast(tt->getFinalOverride()); + m_curWeaponTemplateSet = tt->findWeaponTemplateSet(wsFlags); if (m_curWeaponTemplateSet == nullptr) throw INI_INVALID_DATA;