comparison UI/UIShops.cpp @ 1384:b51332ab228f

changed a few member variables in Player to slightly less confusing names
author Grumpy7
date Tue, 16 Jul 2013 20:51:29 +0200
parents bedc304ab617
children 28f87f5234a1
comparison
equal deleted inserted replaced
1383:0a4254e80036 1384:b51332ab228f
264 return; 264 return;
265 if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5), 265 if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5),
266 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462 266 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462
267 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) ) 267 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
268 return; 268 return;
269 v79 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1]; 269 v79 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
270 v13 = pPlayer->SelectPhrasesTransaction(v79, BildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3); 270 v13 = pPlayer->SelectPhrasesTransaction(v79, BildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3);
271 v7 = BuilDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, v79, (char *)window_SpeakInHouse->ptr_1C, 3, 0); 271 v7 = BuilDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, v79, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
272 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0); 272 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
273 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3); 273 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3);
274 break; 274 break;
283 return; 283 return;
284 if((v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5), 284 if((v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
285 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 285 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
286 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) ) 286 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) )
287 return; 287 return;
288 v4 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1]; 288 v4 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
289 if (!v4->Identified()) 289 if (!v4->Identified())
290 { 290 {
291 v10 = pPlayer->SelectPhrasesTransaction(v4, BildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4); 291 v10 = pPlayer->SelectPhrasesTransaction(v4, BildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4);
292 v7 = BuilDialogueString((char *)pMerchantsIdentifyPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0); 292 v7 = BuilDialogueString((char *)pMerchantsIdentifyPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
293 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0); 293 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0);
312 if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5), 312 if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
313 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 313 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
314 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) 314 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem)
315 || (!(pPlayer->pOwnItems[pNumActiveItem-1].uAttributes& 2)) ) 315 || (!(pPlayer->pOwnItems[pNumActiveItem-1].uAttributes& 2)) )
316 return; 316 return;
317 v4 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1]; 317 v4 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
318 v10 = pPlayer->SelectPhrasesTransaction(v4, BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5); 318 v10 = pPlayer->SelectPhrasesTransaction(v4, BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5);
319 v7 = BuilDialogueString((char *)pMerchantsRepairPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 5, 0); 319 v7 = BuilDialogueString((char *)pMerchantsRepairPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
320 pTextHeight = (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138; 320 pTextHeight = (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138;
321 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorWhite, v7, 3); 321 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorWhite, v7, 3);
322 return; 322 return;
890 return; 890 return;
891 if((v9 = pMouse->GetCursorPos(&v139)->x - 14, pItemCount = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5), 891 if((v9 = pMouse->GetCursorPos(&v139)->x - 14, pItemCount = (v9 >> 5) + 14 * ((pMouse->GetCursorPos(&v133)->y - 17) >> 5),
892 pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462 892 pMouse->GetCursorPos(&v137)->x <= 13) || pMouse->GetCursorPos(&v129)->x >= 462
893 || (v10 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v10) ) 893 || (v10 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v10) )
894 return; 894 return;
895 v116 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v10 - 1]; 895 v116 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v10 - 1];
896 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BildingType_ArmorShop, window_SpeakInHouse->par1C, 3); 896 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BildingType_ArmorShop, window_SpeakInHouse->par1C, 3);
897 v15 = (char *)pMerchantsSellPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BildingType_ArmorShop, window_SpeakInHouse->par1C, 3)]; 897 v15 = (char *)pMerchantsSellPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v116, BildingType_ArmorShop, window_SpeakInHouse->par1C, 3)];
898 v36 = BuilDialogueString(v15, uActiveCharacter - 1, v116, (char *) window_SpeakInHouse->par1C, 3, 0); 898 v36 = BuilDialogueString(v15, uActiveCharacter - 1, v116, (char *) window_SpeakInHouse->par1C, 3, 0);
899 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138; 899 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
900 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3); 900 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
915 if ( pMouse->GetCursorPos(&v143)->x < 462 ) 915 if ( pMouse->GetCursorPos(&v143)->x < 462 )
916 { 916 {
917 v2 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount); 917 v2 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount);
918 if ( v2 ) 918 if ( v2 )
919 { 919 {
920 v3 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v2-1]; 920 v3 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v2-1];
921 if (v3->Identified()) 921 if (v3->Identified())
922 v5 = "%24"; 922 v5 = "%24";
923 else 923 else
924 { 924 {
925 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v3, BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 4); 925 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v3, BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 4);
947 pMouse->GetCursorPos(&v140)->x <= 13) 947 pMouse->GetCursorPos(&v140)->x <= 13)
948 || pMouse->GetCursorPos(&v138)->x >= 462 948 || pMouse->GetCursorPos(&v138)->x >= 462
949 || (v32 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v32) 949 || (v32 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v32)
950 || (!(pPlayers[uActiveCharacter]->pOwnItems[v32-1].uAttributes& 2)) ) 950 || (!(pPlayers[uActiveCharacter]->pOwnItems[v32-1].uAttributes& 2)) )
951 return; 951 return;
952 v116 = &pPlayers[uActiveCharacter]->pInventoryItems[v33 - 1]; 952 v116 = &pPlayers[uActiveCharacter]->pInventoryItemList[v33 - 1];
953 v35 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[v32 - 1], BildingType_ArmorShop, window_SpeakInHouse->par1C, 5); 953 v35 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[v32 - 1], BildingType_ArmorShop, window_SpeakInHouse->par1C, 5);
954 v15 = (char *)pMerchantsRepairPhrases[v35]; 954 v15 = (char *)pMerchantsRepairPhrases[v35];
955 v36 = BuilDialogueString(v15, uActiveCharacter - 1, v116, (char *)window_SpeakInHouse->ptr_1C, 5, 0); 955 v36 = BuilDialogueString(v15, uActiveCharacter - 1, v116, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
956 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138; 956 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
957 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3); 957 dialog_window.DrawTitleText(pFontArrus, 0, v115, pWhiteColor, v36, 3);
958 return; 958 return;
1384 return; 1384 return;
1385 if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5), 1385 if ((v43 = pMouse->GetCursorPos(&v99)->x - 14, v109 = (v43 >> 5) + 14 * ((pMouse->GetCursorPos(&v95)->y - 17) >> 5),
1386 pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462 1386 pMouse->GetCursorPos(&v102)->x <= 13) || pMouse->GetCursorPos(&v100)->x >= 462
1387 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) ) 1387 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
1388 return; 1388 return;
1389 v87 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1]; 1389 v87 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
1390 v45 = pPlayer->SelectPhrasesTransaction(v87, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 3); 1390 v45 = pPlayer->SelectPhrasesTransaction(v87, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 3);
1391 v21 = BuilDialogueString((char *)pMerchantsSellPhrases[v45], uActiveCharacter - 1, v87, (char *)window_SpeakInHouse->ptr_1C, 3, 0); 1391 v21 = BuilDialogueString((char *)pMerchantsSellPhrases[v45], uActiveCharacter - 1, v87, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
1392 pTextHeight = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0); 1392 pTextHeight = pFontArrus->CalcTextHeight(v21, &dialog_window, 0, 0);
1393 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v21, 3); 1393 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v21, 3);
1394 return; 1394 return;
1402 return; 1402 return;
1403 if ((v36 = pMouse->GetCursorPos(&a2)->x - 14, v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5), 1403 if ((v36 = pMouse->GetCursorPos(&a2)->x - 14, v109 = (v36 >> 5) + 14 * ((pMouse->GetCursorPos(&v94)->y - 17) >> 5),
1404 pMouse->GetCursorPos(&v101)->x <= 13) || pMouse->GetCursorPos(&v97)->x >= 462 1404 pMouse->GetCursorPos(&v101)->x <= 13) || pMouse->GetCursorPos(&v97)->x >= 462
1405 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) ) 1405 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v109), !pNumActiveItem) )
1406 return; 1406 return;
1407 v37 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1]; 1407 v37 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1];
1408 if (!v37->Identified()) 1408 if (!v37->Identified())
1409 { 1409 {
1410 v42 = pPlayer->SelectPhrasesTransaction(v37, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 4); 1410 v42 = pPlayer->SelectPhrasesTransaction(v37, BildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 4);
1411 v38 = (char *)pMerchantsIdentifyPhrases[v42]; 1411 v38 = (char *)pMerchantsIdentifyPhrases[v42];
1412 } 1412 }
2135 result = (int)pMouse->GetCursorPos(&v105), 2135 result = (int)pMouse->GetCursorPos(&v105),
2136 *(int *)result <= 13) 2136 *(int *)result <= 13)
2137 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462) 2137 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462)
2138 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) ) 2138 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) )
2139 return; 2139 return;
2140 item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1]; 2140 item = &pPlayers[uActiveCharacter]->pInventoryItemList[result - 1];
2141 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3); 2141 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3);
2142 v30 = BuilDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); 2142 v30 = BuilDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0);
2143 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; 2143 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
2144 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); 2144 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
2145 return; 2145 return;
2160 if ( *(int *)result < 462 ) 2160 if ( *(int *)result < 462 )
2161 { 2161 {
2162 result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117); 2162 result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117);
2163 if ( result ) 2163 if ( result )
2164 { 2164 {
2165 item = &pPlayers[uActiveCharacter]->pInventoryItems[result-1]; 2165 item = &pPlayers[uActiveCharacter]->pInventoryItemList[result-1];
2166 if ( item->uAttributes & 1 ) 2166 if ( item->uAttributes & 1 )
2167 { 2167 {
2168 v5 = BuilDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); 2168 v5 = BuilDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
2169 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101; 2169 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101;
2170 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v5, 3); 2170 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v5, 3);
2194 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462) 2194 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462)
2195 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) 2195 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result)
2196 // || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) ) 2196 // || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) )
2197 || (!(pPlayers[uActiveCharacter]->pOwnItems[result-1].uAttributes& 2)) ) 2197 || (!(pPlayers[uActiveCharacter]->pOwnItems[result-1].uAttributes& 2)) )
2198 return; 2198 return;
2199 item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1]; 2199 item = &pPlayers[uActiveCharacter]->pInventoryItemList[result - 1];
2200 v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[result - 1], BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5); 2200 v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[result - 1], BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5);
2201 v30 = BuilDialogueString((char *)pMerchantsRepairPhrases[v29], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); 2201 v30 = BuilDialogueString((char *)pMerchantsRepairPhrases[v29], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
2202 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; 2202 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138;
2203 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); 2203 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3);
2204 return; 2204 return;
2205 } 2205 }
2350 } 2350 }
2351 taken_item = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID); 2351 taken_item = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID);
2352 if ( taken_item ) 2352 if ( taken_item )
2353 { 2353 {
2354 bought_item->SetIdentified(); 2354 bought_item->SetIdentified();
2355 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[taken_item - 1], bought_item, 0x24u); 2355 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[taken_item - 1], bought_item, 0x24u);
2356 dword_F8B1E4 = 1; 2356 dword_F8B1E4 = 1;
2357 Party::TakeGold(uPriceItemService); 2357 Party::TakeGold(uPriceItemService);
2358 viewparams->bRedrawGameUI = 1; 2358 viewparams->bRedrawGameUI = 1;
2359 bought_item->Reset(); 2359 bought_item->Reset();
2360 pRenderer->ClearZBuffer(0, 479); 2360 pRenderer->ClearZBuffer(0, 479);
2370 v79 = ((pMouse->GetCursorPos(&cursor)->x - 14) >> 5) + 14 * ((pMouse->GetCursorPos(&cursor)->y - 17) >> 5); 2370 v79 = ((pMouse->GetCursorPos(&cursor)->x - 14) >> 5) + 14 * ((pMouse->GetCursorPos(&cursor)->y - 17) >> 5);
2371 if ( pMouse->GetCursorPos(&cursor)->x <= 13 2371 if ( pMouse->GetCursorPos(&cursor)->x <= 13
2372 || pMouse->GetCursorPos(&cursor)->x >= 462 2372 || pMouse->GetCursorPos(&cursor)->x >= 462
2373 || (v15 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79), !v15) ) 2373 || (v15 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79), !v15) )
2374 return; 2374 return;
2375 if ( MerchandiseTest(&pPlayers[uActiveCharacter]->pInventoryItems[v15 - 1], (int)window_SpeakInHouse->ptr_1C) ) 2375 if ( MerchandiseTest(&pPlayers[uActiveCharacter]->pInventoryItemList[v15 - 1], (int)window_SpeakInHouse->ptr_1C) )
2376 { 2376 {
2377 dword_F8B1E4 = 1; 2377 dword_F8B1E4 = 1;
2378 pPlayers[uActiveCharacter]->SalesProcess(v79, v15 - 1, (int)window_SpeakInHouse->ptr_1C); 2378 pPlayers[uActiveCharacter]->SalesProcess(v79, v15 - 1, (int)window_SpeakInHouse->ptr_1C);
2379 viewparams->bRedrawGameUI = 1; 2379 viewparams->bRedrawGameUI = 1;
2380 pRenderer->ClearZBuffer(0, 479); 2380 pRenderer->ClearZBuffer(0, 479);
2393 { 2393 {
2394 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79); 2394 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79);
2395 if ( pItemID ) 2395 if ( pItemID )
2396 { 2396 {
2397 uPriceItemService = pPlayers[uActiveCharacter]->GetPriceIdentification(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier); 2397 uPriceItemService = pPlayers[uActiveCharacter]->GetPriceIdentification(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier);
2398 item = &pPlayers[uActiveCharacter]->pInventoryItems[pItemID - 1]; 2398 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1];
2399 if ( !(item->uAttributes & 1) ) 2399 if ( !(item->uAttributes & 1) )
2400 { 2400 {
2401 if ( MerchandiseTest(item, (int)window_SpeakInHouse->ptr_1C) ) 2401 if ( MerchandiseTest(item, (int)window_SpeakInHouse->ptr_1C) )
2402 { 2402 {
2403 if ( pParty->uNumGold >= uPriceItemService ) 2403 if ( pParty->uNumGold >= uPriceItemService )
2430 if ( pMouse->GetCursorPos(&cursor)->x < 462 ) 2430 if ( pMouse->GetCursorPos(&cursor)->x < 462 )
2431 { 2431 {
2432 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79); 2432 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v79);
2433 if ( pItemID ) 2433 if ( pItemID )
2434 { 2434 {
2435 item = &pPlayers[uActiveCharacter]->pInventoryItems[pItemID - 1]; 2435 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1];
2436 pPriceMultiplier = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; 2436 pPriceMultiplier = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
2437 auto _v = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[pItemID - 1]; 2437 auto _v = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1];
2438 uPriceItemService = pPlayers[uActiveCharacter]->GetPriceRepair(_v->GetValue(), pPriceMultiplier); 2438 uPriceItemService = pPlayers[uActiveCharacter]->GetPriceRepair(_v->GetValue(), pPriceMultiplier);
2439 if ( item->uAttributes & 2 ) 2439 if ( item->uAttributes & 2 )
2440 { 2440 {
2441 if ( MerchandiseTest(item, (int)window_SpeakInHouse->ptr_1C) ) 2441 if ( MerchandiseTest(item, (int)window_SpeakInHouse->ptr_1C) )
2442 { 2442 {
2508 } 2508 }
2509 v39 = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID); 2509 v39 = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID);
2510 if ( v39 ) 2510 if ( v39 )
2511 { 2511 {
2512 bought_item->SetIdentified(); 2512 bought_item->SetIdentified();
2513 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v39 - 1], bought_item, sizeof(ItemGen)); 2513 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v39 - 1], bought_item, sizeof(ItemGen));
2514 if ( pPlayers[uActiveCharacter]->CanSteal() ) 2514 if ( pPlayers[uActiveCharacter]->CanSteal() )
2515 { 2515 {
2516 if ( GetAsyncKeyState(VK_CONTROL) ) 2516 if ( GetAsyncKeyState(VK_CONTROL) )
2517 { 2517 {
2518 if ( uNumSeconds == 1 || uNumSeconds == 2 ) 2518 if ( uNumSeconds == 1 || uNumSeconds == 2 )
2519 { 2519 {
2520 pPlayers[uActiveCharacter]->pInventoryItems[v39 - 1].SetStolen(); 2520 pPlayers[uActiveCharacter]->pInventoryItemList[v39 - 1].SetStolen();
2521 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, uNumSeconds, a6); 2521 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, uNumSeconds, a6);
2522 viewparams->bRedrawGameUI = 1; 2522 viewparams->bRedrawGameUI = 1;
2523 bought_item->Reset(); 2523 bought_item->Reset();
2524 pRenderer->ClearZBuffer(0, 479); 2524 pRenderer->ClearZBuffer(0, 479);
2525 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_75, 0); 2525 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_75, 0);
2612 v5 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos(&v14)->y - 17) >> 5); 2612 v5 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos(&v14)->y - 17) >> 5);
2613 if ( pMouse->GetCursorPos(&v13)->x <= 13 2613 if ( pMouse->GetCursorPos(&v13)->x <= 13
2614 || pMouse->GetCursorPos(&v12)->x >= 462 2614 || pMouse->GetCursorPos(&v12)->x >= 462
2615 || (v9 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&v5)) == 0 ) 2615 || (v9 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&v5)) == 0 )
2616 return; 2616 return;
2617 GameUI_DrawItemInfo(&pPlayers[uActiveCharacter]->pInventoryItems[v9 - 1]); 2617 GameUI_DrawItemInfo(&pPlayers[uActiveCharacter]->pInventoryItemList[v9 - 1]);
2618 return; 2618 return;
2619 } 2619 }
2620 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL ) 2620 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
2621 return; 2621 return;
2622 } 2622 }