File tree 1 file changed +17
-11
lines changed
1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -3668,18 +3668,24 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
3668
3668
a->from_i = m_selected_item->i ;
3669
3669
m_invmgr->inventoryAction (a);
3670
3670
} else if (craft_amount > 0 ) {
3671
- m_selected_content_guess = ItemStack (); // Clear
3672
-
3673
- // Send IAction::Craft
3674
-
3675
3671
assert (s.isValid ());
3676
- assert (inv_s);
3677
-
3678
- infostream << " Handing IAction::Craft to manager" << std::endl;
3679
- ICraftAction *a = new ICraftAction ();
3680
- a->count = craft_amount;
3681
- a->craft_inv = s.inventoryloc ;
3682
- m_invmgr->inventoryAction (a);
3672
+
3673
+ // if there are no items selected or the selected item
3674
+ // belongs to craftresult list, proceed with crafting
3675
+ if (m_selected_item == NULL ||
3676
+ !m_selected_item->isValid () || m_selected_item->listname == " craftresult" ) {
3677
+
3678
+ m_selected_content_guess = ItemStack (); // Clear
3679
+
3680
+ assert (inv_s);
3681
+
3682
+ // Send IACTION_CRAFT
3683
+ infostream << " Handing IACTION_CRAFT to manager" << std::endl;
3684
+ ICraftAction *a = new ICraftAction ();
3685
+ a->count = craft_amount;
3686
+ a->craft_inv = s.inventoryloc ;
3687
+ m_invmgr->inventoryAction (a);
3688
+ }
3683
3689
}
3684
3690
3685
3691
// If m_selected_amount has been decreased to zero, deselect
You can’t perform that action at this time.
0 commit comments