This repository was archived by the owner on Jan 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ namespace RTE {
303
303
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
304
304
305
305
bool InventoryMenuGUI::EnableIfNotEmpty () {
306
- bool shouldEnable = !m_InventoryActorEquippedItems.empty () || !m_InventoryActor->IsInventoryEmpty ();
306
+ bool shouldEnable = !m_InventoryActorEquippedItems.empty () || (m_InventoryActor && !m_InventoryActor->IsInventoryEmpty () );
307
307
SetEnabled (shouldEnable);
308
308
return shouldEnable;
309
309
}
@@ -725,10 +725,12 @@ namespace RTE {
725
725
};
726
726
727
727
for (const auto &[button, icon] : buttonsToCheckIconsFor) {
728
- if (button->IsEnabled ()) {
729
- button->SetIcon ((button->HasFocus () || button->IsMousedOver () || button->IsPushed ()) ? icon->GetBitmaps8 ()[1 ] : icon->GetBitmaps8 ()[0 ]);
730
- } else {
731
- button->SetIcon (icon->GetBitmaps8 ()[2 ]);
728
+ if (icon) {
729
+ if (button->IsEnabled ()) {
730
+ button->SetIcon ((button->HasFocus () || button->IsMousedOver () || button->IsPushed ()) ? icon->GetBitmaps8 ()[1 ] : icon->GetBitmaps8 ()[0 ]);
731
+ } else {
732
+ button->SetIcon (icon->GetBitmaps8 ()[2 ]);
733
+ }
732
734
}
733
735
734
736
if (!button->IsEnabled () && button->GetWidth () == 15 && (button->HasFocus () || button->IsMousedOver () || button->IsPushed ())) {
You can’t perform that action at this time.
0 commit comments