diff 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
line wrap: on
line diff
--- a/mm7_4.cpp	Fri Mar 22 22:36:26 2013 +0200
+++ b/mm7_4.cpp	Fri Mar 22 23:26:01 2013 +0200
@@ -4666,7 +4666,7 @@
                     v26 = &p2DEvents[(signed int)a4 - 1].fPriceMultiplier;
         v27 = *v26;
         v28 = a3->GetValue();
-        v29 = pPlayer->_4B8142(v28, v27);
+        v29 = pPlayer->GetBuyingPrice(v28, v27);
         if ( a5 == 3 )
         {
           v35 = *v26;
@@ -7246,11 +7246,11 @@
     return;
   if ( in_current_building_type <= BildingType_AlchemistShop )
   {
-    if ( dialog_menu_id != 2 )
-    {
-      if ( dialog_menu_id <= 2 )
+    if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
+    {
+      if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
         return;
-      if ( dialog_menu_id <= 5 || dialog_menu_id == 94 )
+      if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_REPAIR || dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT )
       {
         v8 = pMouse->GetCursorPos(&v15)->x - 14;
         v18 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos(&v14)->y - 17) >> 5);
@@ -7263,7 +7263,7 @@
         GameUI_DrawItemInfo(v7);
         return;
       }
-      if ( dialog_menu_id != 95 )
+      if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
         return;
     }
     v4 = pMouse->GetCursorPos(&v11);
@@ -7273,12 +7273,12 @@
       return;
     v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C);
     v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4);
-    if ( dialog_menu_id != 2 )
+    if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
    //   v7 = (ItemGen *)&pParty->field_C59C[v6 + 715];
 		v7 =&pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5];
     goto LABEL_15;
   }
-  if ( in_current_building_type <= BildingType_16 && dialog_menu_id == BildingType_18 )
+  if ( in_current_building_type <= BildingType_16 && dialog_menu_id == HOUSE_DIALOGUE_GULD_BUY_BOOKS )
   {
     v1 = pMouse->GetCursorPos(&a2);
     v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y];
@@ -8875,7 +8875,7 @@
   else
   {
     v17 = HouseNPCData[_this + 1 - ((dword_591080 != 0) + 1)];
-    if ( dialog_menu_id == -1 )
+    if ( dialog_menu_id == HOUSE_DIALOGUE_OTHER )
     {
       pDialogueWindow->Release();
     }
@@ -9381,7 +9381,7 @@
     v4 = v3 / 3;
     v32 = v3 / 3;
   }
-  if ( dialog_menu_id != 1 )
+  if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
   {
     if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
     {
@@ -9393,7 +9393,7 @@
       //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
       // or
       //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
-
+      __debugbreak(); // whacky condition - fix
       if (false
       //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C)
         || (v6 = (int)(&v1->uIntelligence + dialog_menu_id), *(short *)v6) )
@@ -9620,7 +9620,7 @@
   s1 = v4 * (100 - v1->GetMerchant()) / 100;
   if ( (signed int)s1 < v4 / 3 )
     s1 = v4 / 3;
-  if ( dialog_menu_id == 1 )
+  if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN)
   {
     if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
     {
@@ -9744,7 +9744,7 @@
   }
   else
   {
-    if ( dialog_menu_id > 104 && dialog_menu_id <= 108 )
+    if ( dialog_menu_id > HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT && dialog_menu_id <= HOUSE_DIALOGUE_108 )
     {
       if ( pParty->uNumGold < s1 )
       {