diff mm7_2.cpp @ 735:6daaa2f18d0d

Fixed some house sounds & shop-related stuff
author Nomad
date Fri, 22 Mar 2013 20:01:46 +0200
parents 2f4e33c1ed24
children 9cc972ebd3cf
line wrap: on
line diff
--- a/mm7_2.cpp	Fri Mar 22 16:16:40 2013 +0200
+++ b/mm7_2.cpp	Fri Mar 22 20:01:46 2013 +0200
@@ -1698,7 +1698,7 @@
 					v39 = 4;
 				else
 					v39 = 2;
-				HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
+				PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v39);
 				}
 				else
 				{
@@ -1761,7 +1761,7 @@
                       v39 = 4;
                     else
                       v39 = 2;
-                    HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
+                    PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
                   }
                   else
                   {
@@ -1907,7 +1907,7 @@
   int v0; // eax@4
   int v1; // eax@29
   unsigned int v2; // esi@30
-  const char *v3; // ebx@31
+  //const char *v3; // ebx@31
 
   if ( pMessageQueue_50CBD0->uNumMessages )
     pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
@@ -1981,14 +1981,14 @@
       pBtn_ExitCancel = window_SpeakInHouse->pControlsHead;
       if ( uNumDialogueNPCPortraits > 0 )
       {
-        v3 = byte_591180;
+        //v3 = byte_591180;
         do
         {
           HouseNPCData[v2 + 7] = (NPCData *)window_SpeakInHouse->CreateButton(pNPCPortraits_x[v1 - 1][v2], pNPCPortraits_y[v1 - 1][v2],
-                                              0x3Fu, 0x49u, 1, 0, 0x19Au, v2, 0, v3, 0, 0, 0);
+                                              0x3Fu, 0x49u, 1, 0, 0x19Au, v2, 0, byte_591180[v2], 0, 0, 0);
           v1 = uNumDialogueNPCPortraits;
           ++v2;
-          v3 += 100;
+          //v3 += 100;
         }
         while ( (signed int)v2 < uNumDialogueNPCPortraits );
       }
@@ -2004,7 +2004,7 @@
 
 
 //----- (004BDB56) --------------------------------------------------------
-void __cdecl sub_4BDB56_buy_skill____()
+void __cdecl UIShop_Buy_Identify_Repair()
 {
   Player *v0; // edi@1
   signed int v1; // esi@9
@@ -2064,15 +2064,15 @@
   int v55; // [sp+0h] [bp-B4h]@26
   int v56; // [sp+0h] [bp-B4h]@36
   POINT v57; // [sp+10h] [bp-A4h]@49
-  POINT v58; // [sp+18h] [bp-9Ch]@18
+  //POINT v58; // [sp+18h] [bp-9Ch]@18
   POINT v59; // [sp+20h] [bp-94h]@49
   POINT v60; // [sp+28h] [bp-8Ch]@9
   POINT v61; // [sp+30h] [bp-84h]@37
   POINT v62; // [sp+38h] [bp-7Ch]@18
   POINT v63; // [sp+40h] [bp-74h]@37
-  POINT v64; // [sp+48h] [bp-6Ch]@19
+  //POINT v64; // [sp+48h] [bp-6Ch]@19
   POINT v65; // [sp+50h] [bp-64h]@32
-  POINT v66; // [sp+58h] [bp-5Ch]@18
+  //POINT v66; // [sp+58h] [bp-5Ch]@18
   POINT v67; // [sp+60h] [bp-54h]@31
   POINT a2; // [sp+68h] [bp-4Ch]@9
   POINT v69; // [sp+70h] [bp-44h]@31
@@ -2135,7 +2135,7 @@
 		{
 			v24 = 2;
 	//LABEL_62:
-			HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v24);
+			PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v24);
 			v9 = pGlobalTXT_LocalizationStrings[155];
 			v54 = 2;
 			ShowStatusBarString(v9, v54);
@@ -2198,14 +2198,14 @@
 		pAudioPlayer->PlaySound(SOUND_27, v46, v47, v48, v49, v50, v52, v56);
 		break;
 		}
+
 	case 4:
+    {
+      pMouse->GetCursorPos(&v62);
+		v10 = v62.x - 14;
+		v79 = (v10 >> 5) + 14 * ((v62.y - 17) >> 5);
+		if (v62.x > 13  && v62.x < 462)
 		{
-		v10 = pMouse->GetCursorPos(&v62)->x - 14;
-		v79 = (v10 >> 5) + 14 * ((pMouse->GetCursorPos(&v66)->y - 17) >> 5);
-		if ( pMouse->GetCursorPos(&v58)->x > 13 )
-		{
-			if ( pMouse->GetCursorPos(&v64)->x < 462 )
-			{
 			v11 = v0->GetItemIDAtInventoryIndex((int *)&v79);
 			if ( v11 )
 			{
@@ -2230,7 +2230,7 @@
 					}
 					v13 = _this;
 					v55 = 2;
-					HousePlaySomeSound((unsigned int)v13, v55);
+					PlayHouseSound((unsigned int)v13, (HouseSoundID)v55);
 					return;
 				}
 				pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
@@ -2247,7 +2247,6 @@
 				v27->PlaySound((PlayerSpeech)v51, v53);
 				return;
 			}
-			}
 		}
 		break;
 		}
@@ -2296,7 +2295,7 @@
 						v13 = _this;
 						v55 = 2;
 			//LABEL_84:
-						HousePlaySomeSound((unsigned int)v13, v55);
+						PlayHouseSound((unsigned int)v13, (HouseSoundID)v55);
 						return;
 						}
 						pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
@@ -2372,7 +2371,7 @@
 			{
 				if ( uNumSeconds != 1 )
 				{
-					HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v24);
+					PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v24);
 					v9 = pGlobalTXT_LocalizationStrings[155];
 					v54 = 2;
 					ShowStatusBarString(v9, v54);
@@ -2451,7 +2450,7 @@
 							v55 = 4;
 						else
 							v55 = 2;
-						HousePlaySomeSound((unsigned int)v13, v55);
+						PlayHouseSound((unsigned int)v13, (HouseSoundID)v55);
 						return;
 					}
 					Party::TakeGold(v44);