diff UIHouses.cpp @ 1019:32ec62bbaa2c

player use item part cleanup
author Gloval
date Tue, 21 May 2013 01:21:10 +0400
parents a704435d3285
children 3413ad40cc88
line wrap: on
line diff
--- a/UIHouses.cpp	Sun May 19 20:39:45 2013 +0400
+++ b/UIHouses.cpp	Tue May 21 01:21:10 2013 +0400
@@ -3071,7 +3071,7 @@
       if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5),
           pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462
             || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem)
-            || (pNumActiveItem = 9 * pNumActiveItem, !(pPlayer->field_1F5[4 * pNumActiveItem + 15] & 2)) )
+            || (!(pPlayer->pOwnItems[pNumActiveItem-1].uAttributes& 2)) )
             return;
       v4 = (ItemGen *)&pPlayer->pInventoryItems[pNumActiveItem - 1];
       v10 = pPlayer->SelectPhrasesTransaction(v4, BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5);
@@ -4274,10 +4274,10 @@
             pMouse->GetCursorPos(&v140)->x <= 13)
             || pMouse->GetCursorPos(&v138)->x >= 462
             || (v32 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v32)
-            || (v33 = 9 * v32, !(pPlayers[uActiveCharacter]->field_1F5[4 * v33 + 15] & 2)) )
+            || (!(pPlayers[uActiveCharacter]->pOwnItems[v32-1].uAttributes& 2)) )
         return;
       v116 = &pPlayers[uActiveCharacter]->pInventoryItems[v33 - 1];
-      v35 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[v33 - 1], BildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5);
+      v35 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[v32 - 1], BildingType_ArmorShop, window_SpeakInHouse->par1C, 5);
       v15 = (char *)pMerchantsRepairPhrases[v35];
       v36 = BuilDialogueString(v15, uActiveCharacter - 1, v116, (char *)window_SpeakInHouse->ptr_1C, 5, 0);
       v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138;
@@ -6008,7 +6008,8 @@
           *(int *)result <= 13)
       || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462)
       || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result)
-      || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) )
+     // || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) )
+        || (!(pPlayers[uActiveCharacter]->pOwnItems[result-1].uAttributes& 2)) )
       return;
     item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1];
     v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[result - 1], BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5);