Mercurial > mm7
comparison mm7_4.cpp @ 749:f39fbeb65b28
Fixed bought items not disappearing from Armourer.
author | Nomad |
---|---|
date | Fri, 22 Mar 2013 23:26:01 +0200 |
parents | 585490c29945 |
children | 9f7db515a8d7 7f1487b74571 |
comparison
equal
deleted
inserted
replaced
748:daecb0225226 | 749:f39fbeb65b28 |
---|---|
4664 case 27: | 4664 case 27: |
4665 { | 4665 { |
4666 v26 = &p2DEvents[(signed int)a4 - 1].fPriceMultiplier; | 4666 v26 = &p2DEvents[(signed int)a4 - 1].fPriceMultiplier; |
4667 v27 = *v26; | 4667 v27 = *v26; |
4668 v28 = a3->GetValue(); | 4668 v28 = a3->GetValue(); |
4669 v29 = pPlayer->_4B8142(v28, v27); | 4669 v29 = pPlayer->GetBuyingPrice(v28, v27); |
4670 if ( a5 == 3 ) | 4670 if ( a5 == 3 ) |
4671 { | 4671 { |
4672 v35 = *v26; | 4672 v35 = *v26; |
4673 v36 = a3->GetValue(); | 4673 v36 = a3->GetValue(); |
4674 v29 = pPlayer->_4B8102(v36, v35); | 4674 v29 = pPlayer->_4B8102(v36, v35); |
7244 //v0 = pPlayers[uActiveCharacter]; | 7244 //v0 = pPlayers[uActiveCharacter]; |
7245 if ( in_current_building_type <= 0 ) | 7245 if ( in_current_building_type <= 0 ) |
7246 return; | 7246 return; |
7247 if ( in_current_building_type <= BildingType_AlchemistShop ) | 7247 if ( in_current_building_type <= BildingType_AlchemistShop ) |
7248 { | 7248 { |
7249 if ( dialog_menu_id != 2 ) | 7249 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) |
7250 { | 7250 { |
7251 if ( dialog_menu_id <= 2 ) | 7251 if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_BUY_STANDARD) |
7252 return; | 7252 return; |
7253 if ( dialog_menu_id <= 5 || dialog_menu_id == 94 ) | 7253 if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_REPAIR || dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT ) |
7254 { | 7254 { |
7255 v8 = pMouse->GetCursorPos(&v15)->x - 14; | 7255 v8 = pMouse->GetCursorPos(&v15)->x - 14; |
7256 v18 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos(&v14)->y - 17) >> 5); | 7256 v18 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos(&v14)->y - 17) >> 5); |
7257 if ( pMouse->GetCursorPos(&v13)->x <= 13 | 7257 if ( pMouse->GetCursorPos(&v13)->x <= 13 |
7258 || pMouse->GetCursorPos(&v12)->x >= 462 | 7258 || pMouse->GetCursorPos(&v12)->x >= 462 |
7261 v7 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v9-1]; | 7261 v7 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v9-1]; |
7262 LABEL_15: | 7262 LABEL_15: |
7263 GameUI_DrawItemInfo(v7); | 7263 GameUI_DrawItemInfo(v7); |
7264 return; | 7264 return; |
7265 } | 7265 } |
7266 if ( dialog_menu_id != 95 ) | 7266 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL ) |
7267 return; | 7267 return; |
7268 } | 7268 } |
7269 v4 = pMouse->GetCursorPos(&v11); | 7269 v4 = pMouse->GetCursorPos(&v11); |
7270 v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v10)->y]] & 0xFFFF; | 7270 v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v10)->y]] & 0xFFFF; |
7271 v18 = v5; | 7271 v18 = v5; |
7272 if ( !v5 ) | 7272 if ( !v5 ) |
7273 return; | 7273 return; |
7274 v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C); | 7274 v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C); |
7275 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4); | 7275 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4); |
7276 if ( dialog_menu_id != 2 ) | 7276 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) |
7277 // v7 = (ItemGen *)&pParty->field_C59C[v6 + 715]; | 7277 // v7 = (ItemGen *)&pParty->field_C59C[v6 + 715]; |
7278 v7 =&pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5]; | 7278 v7 =&pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5]; |
7279 goto LABEL_15; | 7279 goto LABEL_15; |
7280 } | 7280 } |
7281 if ( in_current_building_type <= BildingType_16 && dialog_menu_id == BildingType_18 ) | 7281 if ( in_current_building_type <= BildingType_16 && dialog_menu_id == HOUSE_DIALOGUE_GULD_BUY_BOOKS ) |
7282 { | 7282 { |
7283 v1 = pMouse->GetCursorPos(&a2); | 7283 v1 = pMouse->GetCursorPos(&a2); |
7284 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y]; | 7284 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y]; |
7285 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; | 7285 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; |
7286 v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; | 7286 v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; |
8873 pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, sHouseName, 0); | 8873 pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, sHouseName, 0); |
8874 } | 8874 } |
8875 else | 8875 else |
8876 { | 8876 { |
8877 v17 = HouseNPCData[_this + 1 - ((dword_591080 != 0) + 1)]; | 8877 v17 = HouseNPCData[_this + 1 - ((dword_591080 != 0) + 1)]; |
8878 if ( dialog_menu_id == -1 ) | 8878 if ( dialog_menu_id == HOUSE_DIALOGUE_OTHER ) |
8879 { | 8879 { |
8880 pDialogueWindow->Release(); | 8880 pDialogueWindow->Release(); |
8881 } | 8881 } |
8882 else | 8882 else |
8883 { | 8883 { |
9379 if ( v4 < v3 / 3 ) | 9379 if ( v4 < v3 / 3 ) |
9380 { | 9380 { |
9381 v4 = v3 / 3; | 9381 v4 = v3 / 3; |
9382 v32 = v3 / 3; | 9382 v32 = v3 / 3; |
9383 } | 9383 } |
9384 if ( dialog_menu_id != 1 ) | 9384 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN) |
9385 { | 9385 { |
9386 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 9386 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
9387 { | 9387 { |
9388 v5 = 0; | 9388 v5 = 0; |
9389 | 9389 |
9391 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23] | 9391 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23] |
9392 // or | 9392 // or |
9393 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36] | 9393 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36] |
9394 // or | 9394 // or |
9395 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1] | 9395 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1] |
9396 | 9396 __debugbreak(); // whacky condition - fix |
9397 if (false | 9397 if (false |
9398 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C) | 9398 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C) |
9399 || (v6 = (int)(&v1->uIntelligence + dialog_menu_id), *(short *)v6) ) | 9399 || (v6 = (int)(&v1->uIntelligence + dialog_menu_id), *(short *)v6) ) |
9400 { | 9400 { |
9401 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | 9401 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); |
9618 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]); | 9618 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]); |
9619 v4 = (signed __int64)((double)(signed int)v59 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier); | 9619 v4 = (signed __int64)((double)(signed int)v59 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier); |
9620 s1 = v4 * (100 - v1->GetMerchant()) / 100; | 9620 s1 = v4 * (100 - v1->GetMerchant()) / 100; |
9621 if ( (signed int)s1 < v4 / 3 ) | 9621 if ( (signed int)s1 < v4 / 3 ) |
9622 s1 = v4 / 3; | 9622 s1 = v4 / 3; |
9623 if ( dialog_menu_id == 1 ) | 9623 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN) |
9624 { | 9624 { |
9625 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 9625 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
9626 { | 9626 { |
9627 v16 = pDialogueWindow; | 9627 v16 = pDialogueWindow; |
9628 v58 = -1; | 9628 v58 = -1; |
9742 } | 9742 } |
9743 } | 9743 } |
9744 } | 9744 } |
9745 else | 9745 else |
9746 { | 9746 { |
9747 if ( dialog_menu_id > 104 && dialog_menu_id <= 108 ) | 9747 if ( dialog_menu_id > HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT && dialog_menu_id <= HOUSE_DIALOGUE_108 ) |
9748 { | 9748 { |
9749 if ( pParty->uNumGold < s1 ) | 9749 if ( pParty->uNumGold < s1 ) |
9750 { | 9750 { |
9751 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); | 9751 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); |
9752 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2); | 9752 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2); |