comparison mm7_5.cpp @ 1577:1b6217e07b26

OnInventoryItemRightClick logic restored
author Nomad
date Tue, 10 Sep 2013 18:43:52 +0200
parents e66e0c89d81b
children 85a099ea7975
comparison
equal deleted inserted replaced
1576:e66e0c89d81b 1577:1b6217e07b26
5018 int alchemy_skill = SkillToMastery(alchemy_level); 5018 int alchemy_skill = SkillToMastery(alchemy_level);
5019 5019
5020 auto item = &player->pInventoryItemList[item_pid]; 5020 auto item = &player->pInventoryItemList[item_pid];
5021 if (pParty->pPickedItem.uItemID == ITEM_POTION_BOTTLE) 5021 if (pParty->pPickedItem.uItemID == ITEM_POTION_BOTTLE)
5022 { 5022 {
5023 LABEL_116: 5023 __show_item_desc:
5024 GameUI_DrawItemInfo(item); 5024 GameUI_DrawItemInfo(item);
5025 return; 5025 return;
5026 } 5026 }
5027 5027
5028 if (pParty->pPickedItem.uItemID == ITEM_POTION_RECHARGE_ITEM) 5028 if (pParty->pPickedItem.uItemID == ITEM_POTION_RECHARGE_ITEM)
5046 5046
5047 pMouse->RemoveHoldingItem(); 5047 pMouse->RemoveHoldingItem();
5048 no_rightlick_in_inventory = 1; 5048 no_rightlick_in_inventory = 1;
5049 return; 5049 return;
5050 } 5050 }
5051 goto __show_item_desc;
5051 } 5052 }
5052 5053
5053 else if (pParty->pPickedItem.uItemID == ITEM_POTION_HARDEN_ITEM) 5054 else if (pParty->pPickedItem.uItemID == ITEM_POTION_HARDEN_ITEM)
5054 { 5055 {
5055 if (item->uItemID != ITEM_POTION_BOTTLE && // cant harden bottle 5056 if (item->uItemID != ITEM_POTION_BOTTLE && // cant harden bottle
5067 _50C9A8_item_enchantment_timer = 256; 5068 _50C9A8_item_enchantment_timer = 256;
5068 pMouse->RemoveHoldingItem(); 5069 pMouse->RemoveHoldingItem();
5069 no_rightlick_in_inventory = true; 5070 no_rightlick_in_inventory = true;
5070 return; 5071 return;
5071 } 5072 }
5073 goto __show_item_desc;
5072 } 5074 }
5073 5075
5074 else if (pParty->pPickedItem.uItemID >= ITEM_POTION_FLAMING_POTION && 5076 else if (pParty->pPickedItem.uItemID >= ITEM_POTION_FLAMING_POTION &&
5075 pParty->pPickedItem.uItemID <= ITEM_POTION_SWIFT_POTION || 5077 pParty->pPickedItem.uItemID <= ITEM_POTION_SWIFT_POTION ||
5076 pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION) 5078 pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION)
5111 _50C9A8_item_enchantment_timer = 256; 5113 _50C9A8_item_enchantment_timer = 256;
5112 pMouse->RemoveHoldingItem(); 5114 pMouse->RemoveHoldingItem();
5113 no_rightlick_in_inventory = true; 5115 no_rightlick_in_inventory = true;
5114 return; 5116 return;
5115 } 5117 }
5118 goto __show_item_desc;
5116 } 5119 }
5117 5120
5118 5121
5119 5122
5120 if (pParty->pPickedItem.uItemID < ITEM_REAGENT_WIDOWSWEEP_BERRIES || 5123 if (pParty->pPickedItem.uItemID < ITEM_REAGENT_WIDOWSWEEP_BERRIES ||
5128 { 5131 {
5129 if (pParty->pPickedItem.uItemID != ITEM_POTION_HARDEN_ITEM && 5132 if (pParty->pPickedItem.uItemID != ITEM_POTION_HARDEN_ITEM &&
5130 (pParty->pPickedItem.uItemID < ITEM_POTION_FLAMING_POTION || pParty->pPickedItem.uItemID > ITEM_POTION_SWIFT_POTION) && 5133 (pParty->pPickedItem.uItemID < ITEM_POTION_FLAMING_POTION || pParty->pPickedItem.uItemID > ITEM_POTION_SWIFT_POTION) &&
5131 pParty->pPickedItem.uItemID != ITEM_POTION_SLAYING_POTION && 5134 pParty->pPickedItem.uItemID != ITEM_POTION_SLAYING_POTION &&
5132 pParty->pPickedItem.uItemID != ITEM_POTION_RECHARGE_ITEM) 5135 pParty->pPickedItem.uItemID != ITEM_POTION_RECHARGE_ITEM)
5133 goto LABEL_116; 5136 goto __show_item_desc;
5134 } 5137 }
5135 5138
5136 // src not reagent, dst not bottle 5139 // src not reagent, dst not bottle
5137 // src potion, dst potion 5140 // src potion, dst potion
5138 5141
5214 } 5217 }
5215 } 5218 }
5216 v18 = pOut_y; 5219 v18 = pOut_y;
5217 LABEL_59: 5220 LABEL_59:
5218 if ( !v51 ) 5221 if ( !v51 )
5219 goto LABEL_116; 5222 goto __show_item_desc;;
5220 if ( v51 == 1 ) 5223 if ( v51 == 1 )
5221 { 5224 {
5222 player->RemoveItemAtInventoryIndex(v18); 5225 player->RemoveItemAtInventoryIndex(v18);
5223 v26 = rand(); 5226 v26 = rand();
5224 player->ReceiveDamage(v26 % 11 + 10, DMGT_FIRE); 5227 player->ReceiveDamage(v26 % 11 + 10, DMGT_FIRE);
5288 if ( v21 ) 5291 if ( v21 )
5289 //*(int *)&v0->field_1F5[36 * v21 + 15] = 1; 5292 //*(int *)&v0->field_1F5[36 * v21 + 15] = 1;
5290 player->pOwnItems[v21-1].uAttributes=ITEM_IDENTIFIED; 5293 player->pOwnItems[v21-1].uAttributes=ITEM_IDENTIFIED;
5291 goto LABEL_74; 5294 goto LABEL_74;
5292 } 5295 }
5293 goto LABEL_116; 5296 goto __show_item_desc;
5294 } 5297 }
5295 player->RemoveItemAtInventoryIndex(v18); 5298 player->RemoveItemAtInventoryIndex(v18);
5296 player->SetCondition(0x10u, 0); 5299 player->SetCondition(0x10u, 0);
5297 v23 = 0; 5300 v23 = 0;
5298 } 5301 }