Skip to content

Commit 6a9fb6b

Browse files
authored
[Minor] Fix with SuperWeapon Sidebar (#1815)
1 parent 00ec62e commit 6a9fb6b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Ext/Sidebar/SWSidebar/SWSidebarClass.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ bool SWSidebarClass::AddButton(int superIdx)
132132

133133
const auto pSWExt = SWTypeExt::ExtMap.Find(pSWType);
134134

135-
if (!pSWExt->SW_ShowCameo || !pSWExt->SuperWeaponSidebar_Allow.Get(RulesExt::Global()->SuperWeaponSidebar_AllowByDefault))
135+
if (!pSWExt->SW_ShowCameo && pSWExt->SW_AutoFire)
136+
return false;
137+
138+
if (!pSWExt->SuperWeaponSidebar_Allow.Get(RulesExt::Global()->SuperWeaponSidebar_AllowByDefault))
136139
return false;
137140

138141
const unsigned int ownerBits = 1u << HouseClass::CurrentPlayer->Type->ArrayIndex;
@@ -148,6 +151,9 @@ bool SWSidebarClass::AddButton(int superIdx)
148151
if (columns.empty() && !this->AddColumn())
149152
return false;
150153

154+
if (std::ranges::any_of(columns, [superIdx](SWColumnClass* column) { return std::ranges::any_of(column->Buttons, [superIdx](SWButtonClass* button) { return button->SuperIndex == superIdx; }); }))
155+
return true;
156+
151157
return columns.back()->AddButton(superIdx);
152158
}
153159

0 commit comments

Comments
 (0)