changeset 1754:421c29d4ab3e

UITransition.cpp cleaning(continue)
author Ritor1
date Mon, 30 Sep 2013 17:29:27 +0600
parents 999bf8c99514
children dc5d8edf629a 5be18330f9a3
files AudioPlayer.h Player.cpp SaveLoad.cpp UI/UICharacter.cpp UI/UIGuilds.cpp UI/UIHouses.cpp UI/UIPopup.cpp UI/UIShops.cpp UI/UITransition.cpp mm7_4.cpp mm7_5.cpp mm7_data.h
diffstat 12 files changed, 107 insertions(+), 146 deletions(-) [+]
line wrap: on
line diff
--- a/AudioPlayer.h	Mon Sep 30 11:41:55 2013 +0600
+++ b/AudioPlayer.h	Mon Sep 30 17:29:27 2013 +0600
@@ -77,7 +77,8 @@
   SOUND_EnteringAHouse = 0x6,
   SOUND_7 = 7,
   SOUND_8 = 0x8,
-  SOUND_27 = 0x1B,
+  SOUND_24 = 24,
+  SOUND_error = 27,
   SOUND_64 = 64,
   SOUND_Button = 66,
   SOUND_67 = 67,
--- a/Player.cpp	Mon Sep 30 11:41:55 2013 +0600
+++ b/Player.cpp	Mon Sep 30 17:29:27 2013 +0600
@@ -918,7 +918,7 @@
   }
   if ( !CanFitItem(index, uItemID) )
   {
-    pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+    pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
     return 0;
   }
   return CreateItemInInventory(index, uItemID);
--- a/SaveLoad.cpp	Mon Sep 30 11:41:55 2013 +0600
+++ b/SaveLoad.cpp	Mon Sep 30 17:29:27 2013 +0600
@@ -58,7 +58,7 @@
   dword_5B65C8_timers_count = 0;
   if (!pSavegameUsedSlots[uSlot])
   {
-    pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+    pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
     Log::Warning(L"LoadGame: slot %u is empty", uSlot);
     return;
   }
--- a/UI/UICharacter.cpp	Mon Sep 30 11:41:55 2013 +0600
+++ b/UI/UICharacter.cpp	Mon Sep 30 17:29:27 2013 +0600
@@ -2405,7 +2405,7 @@
         }
         if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() && (pEquipType != EQUIP_ARMOUR || bUnderwater) )
         {
-          pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
           return;
         }
         pPlayers[uActiveCharacter]->EquipBody(pEquipType);
@@ -2416,7 +2416,7 @@
       case EQUIP_RING:
         if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() )
         {
-          pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
           return;
         }
         //слоты для колец
@@ -2453,7 +2453,7 @@
       case EQUIP_SHIELD://Щит
         if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() )//в акваланге
         {
-          pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
           return;
         }
         if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )//нет навыка
@@ -2506,7 +2506,7 @@
           && pParty->pPickedItem.uItemID != 64
           && pParty->pPickedItem.uItemID != 65 )
         {
-          pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
           return;
         }
         if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )
@@ -2608,7 +2608,7 @@
       case EQUIP_MAIN_HAND:
         if ( pPlayers[uActiveCharacter]->HasUnderwaterSuitEquipped() )
         {
-          pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
           return;
         }
         if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )
@@ -2620,7 +2620,7 @@
         {
           if ( v2 )
           {
-            pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
             return;
           }
           --v1;
@@ -2677,7 +2677,7 @@
     {
       if ( bUnderwater )
       {
-        pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
         return;
       }
       WetsuitOff(uActiveCharacter);
--- a/UI/UIGuilds.cpp	Mon Sep 30 11:41:55 2013 +0600
+++ b/UI/UIGuilds.cpp	Mon Sep 30 17:29:27 2013 +0600
@@ -249,7 +249,7 @@
       {
         sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[403], pClassNames[dialog_menu_id - 16]); //"You already know the %s skill"
         ShowStatusBarString(pTmpBuf.data(), 2);
-        pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
       }
       else
       {
--- a/UI/UIHouses.cpp	Mon Sep 30 11:41:55 2013 +0600
+++ b/UI/UIHouses.cpp	Mon Sep 30 17:29:27 2013 +0600
@@ -1606,7 +1606,7 @@
       else
       {
         dialog_menu_id = HOUSE_DIALOGUE_MAIN;
-        pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
       }
     }
   }
@@ -2809,7 +2809,7 @@
     //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C)
       || (v6 = (int)(&pPlayers[uActiveCharacter]->uIntelligence + dialog_menu_id), *(short *)v6) )
     {
-      pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
     }
     else
     {
--- a/UI/UIPopup.cpp	Mon Sep 30 11:41:55 2013 +0600
+++ b/UI/UIPopup.cpp	Mon Sep 30 17:29:27 2013 +0600
@@ -1662,7 +1662,7 @@
     {
       if (item->GetItemEquipType() != EQUIP_WAND) // can recharge only wands
       {
-        pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
         return;
       }
 
@@ -1995,3 +1995,4 @@
   GameUI_DrawItemInfo(item);
   return;
 }
+
--- a/UI/UIShops.cpp	Mon Sep 30 11:41:55 2013 +0600
+++ b/UI/UIShops.cpp	Mon Sep 30 17:29:27 2013 +0600
@@ -1488,7 +1488,7 @@
   }
   if ( !HouseUI_CheckIfPlayerCanInteract() )
   {
-    pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+    pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
     return;
   }
 
@@ -1502,8 +1502,8 @@
     }
     case HOUSE_DIALOGUE_GUILD_BUY_BOOKS:
     {
-      pCursorPos = pMouse->GetCursorPos(&cursor);
-      v18 = pRenderer->pActiveZBuffer[pCursorPos->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&cursor)->y]] & 0xFFFF;
+      pMouse->GetCursorPos(&cursor);
+      v18 = pRenderer->pActiveZBuffer[cursor.x + pSRZBufferLineOffsets[cursor.y]] & 0xFFFF;
       if ( !v18 )
         return;
       bought_item = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v18 + 12 * (int)window_SpeakInHouse->ptr_1C));
@@ -1550,7 +1550,7 @@
         return;
       }
       pPlayers[uActiveCharacter]->PlaySound(SPEECH_79, 0);
-      pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
       break;
     }
     case HOUSE_DIALOGUE_SHOP_IDENTIFY:
@@ -1580,7 +1580,7 @@
               PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2);
               return;
             }
-            pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
             pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)79, 0);
             return;
           }
@@ -1622,7 +1622,7 @@
                 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2);
                 return;
               }
-              pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+              pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
               pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)79, 0);
               return;
             }
@@ -1643,7 +1643,7 @@
       if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
         bought_item = (ItemGen *)&pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v18 - 1];
       else
-        bought_item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v18 - 1];//(ItemGen *)&pParty->field_C59C[v31 + 724];
+        bought_item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v18 - 1];
       uPriceItemService = pPlayers[uActiveCharacter]->GetBuyingPrice(bought_item->GetValue(), p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier);
       uNumSeconds = 0;
       a3 = 0;
@@ -1748,64 +1748,47 @@
 //----- (004B1A2D) --------------------------------------------------------
 void  ShowPopupShopItem()
 {
-  POINT *v1; // esi@5
-  unsigned int v2; // eax@5
   int v3; // ecx@5
-  POINT *v4; // esi@12
-  int v5; // eax@12
   unsigned int v6; // eax@13
   ItemGen *v7; // ecx@13
-  signed int v8; // esi@17
-  unsigned int v9; // eax@19
-  POINT v10; // [sp+8h] [bp-44h]@12
-  POINT v11; // [sp+10h] [bp-3Ch]@12
-  POINT  v12; // [sp+18h] [bp-34h]@18
-  POINT  v13; // [sp+20h] [bp-2Ch]@17
-  POINT v14; // [sp+28h] [bp-24h]@17
-  POINT  v15; // [sp+30h] [bp-1Ch]@17
-  POINT v16; // [sp+38h] [bp-14h]@5
-  POINT a2; // [sp+40h] [bp-Ch]@5
+  POINT  cursor; // [sp+30h] [bp-1Ch]@17
 
   if ( in_current_building_type <= 0 )
     return;
+  if ( dialog_menu_id < HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
+    return;
   if ( in_current_building_type <= BuildingType_AlchemistShop )
   {
-    if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
+    if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
     {
-      if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
-        return;
-      if ( dialog_menu_id <= HOUSE_DIALOGUE_SHOP_REPAIR || dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT )
-      {
-        v8 = pMouse->GetCursorPos(&v15)->x - 14;
-        v5 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos(&v14)->y - 17) >> 5);
-        if ( pMouse->GetCursorPos(&v13)->x <= 13
-          || pMouse->GetCursorPos(&v12)->x >= 462
-          || (v9 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&v5)) == 0 )
-          return;
-        GameUI_DrawItemInfo(&pPlayers[uActiveCharacter]->pInventoryItemList[v9 - 1]);
+      pMouse->GetCursorPos(&cursor);
+      v3 = pRenderer->pActiveZBuffer[cursor.x + pSRZBufferLineOffsets[cursor.y]] & 0xFFFF;
+      if ( !v3 )
         return;
-      }
-      if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL )
-        return;
+      v7 = &pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v3 - 1];
+      if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL)
+        v7 = &pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v3 - 1];
+      GameUI_DrawItemInfo(v7);
+      return;
     }
-    v4 = pMouse->GetCursorPos(&v11);
-    v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v10)->y]] & 0xFFFF;
-    if ( !v5 )
+
+    if ( dialog_menu_id >= HOUSE_DIALOGUE_SHOP_SELL && dialog_menu_id <= HOUSE_DIALOGUE_SHOP_REPAIR
+      || dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT )
+    {
+      pMouse->GetCursorPos(&cursor);
+      v3 = ((cursor.x - 14) >> 5) + 14 * ((cursor.y - 17) >> 5);
+      if ( cursor.x <= 13 || cursor.x >= 462
+        || !pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&v3) )
+        return;
+      GameUI_DrawItemInfo(&pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&v3) - 1]);
       return;
-    v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C);
-    v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4);
-    if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
-      v7 = &pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5 - 1];
-    GameUI_DrawItemInfo(v7);
-    return;
+    }
   }
   if ( in_current_building_type <= BuildingType_16 && dialog_menu_id == HOUSE_DIALOGUE_GUILD_BUY_BOOKS )
   {
-    v1 = pMouse->GetCursorPos(&a2);
-    v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y];
-    v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
-    v5 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
-    if ( v5 )
+    pMouse->GetCursorPos(&cursor);
+    v3 = pRenderer->pActiveZBuffer[cursor.x + pSRZBufferLineOffsets[cursor.y]] & 0xFFFF;
+    if ( v3 )
       sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C));
   }
 }
--- a/UI/UITransition.cpp	Mon Sep 30 11:41:55 2013 +0600
+++ b/UI/UITransition.cpp	Mon Sep 30 17:29:27 2013 +0600
@@ -26,18 +26,9 @@
 //----- (00444839) --------------------------------------------------------
 void TransitionUI_Load(uint anim_id, uint exit_pic_id, int x, int y, int z, int directiony, int directionx, int a8, const char *pLocationName)
 {
-  unsigned int v12; // eax@6
-  const char *v13; // ST0C_4@6
-  unsigned int v14; // eax@8
   const char *v15; // eax@14
-  unsigned int v16; // eax@16
-  const char *v18; // [sp-8h] [bp-40h]@9
-  char *v20; // [sp-4h] [bp-3Ch]@9
-  const char *v21; // [sp-4h] [bp-3Ch]@11
   char pContainer[40]; // [sp+Ch] [bp-2Ch]@1
-  unsigned int v23; // [sp+34h] [bp-4h]@1
 
-  v23 = IndoorLocation::GetLocationIndex(pLocationName);
   dword_59117C_teleportx = x;
   dword_591178_teleporty = y;
   dword_591174_teleportz = z;
@@ -57,48 +48,58 @@
     default: Error("Invalid alignment: %u", pParty->alignment);
   }
 
-  v12 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
-  v13 = pHouse_ExitPictures[exit_pic_id];
-  pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v12];
-  pTexture_outside = pIcons_LOD->LoadTexturePtr(v13, TEXTURE_16BIT_PALETTE);
+  pTexture_Dialogue_Background = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)];
+  pTexture_outside = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[exit_pic_id], TEXTURE_16BIT_PALETTE);
   if (anim_id)
   {
-    if ( !v23 )
-      //pVideoPlayer->OpenHouseMovie(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_0, 1u);
+    if ( !IndoorLocation::GetLocationIndex(pLocationName) )
       pVideoPlayer->OpenHouseMovie(pAnimatedRooms[p2DEvents[anim_id - 1].uAnimationID].video_name, 1);
   }
-  else if ( !v23 )
+  else if ( !IndoorLocation::GetLocationIndex(pLocationName) )
   {
-      v14 = pMapStats->GetMapInfo(pCurrentMapName);
-      if ( v14 )
-      {
-        sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v14].pName); // "Leave %s"
-        goto LABEL_20;
-      }
-      v21 = pGlobalTXT_LocalizationStrings[79];
-      goto LABEL_19;
+    if ( pMapStats->GetMapInfo(pCurrentMapName) )
+    {
+      sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName); // "Leave %s"
+      pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Transition, 0, sHouseName.data());
+      //if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
+        //PlayHouseSound(anim_id, HouseSound_Greeting);
+      if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
+        pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
+      if ( IndoorLocation::GetLocationIndex(pLocationName) )
+        uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
+      return;
+    }
+    strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[79]);
+    pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Transition, 0, sHouseName.data());
+    //if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
+      //PlayHouseSound(anim_id, HouseSound_Greeting);
+    if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
+      pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
+    if ( IndoorLocation::GetLocationIndex(pLocationName) )
+      uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
+    return;
   }
   v15 = pLocationName;
   if ( *pLocationName == 48 )
     v15 = pCurrentMapName;
-  v16 = pMapStats->GetMapInfo(v15);
-  if ( v16 )
+  if ( pMapStats->GetMapInfo(v15) )
   {
-    sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[411], pMapStats->pInfos[v16].pName);
-    goto LABEL_20;
+    sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[411], pMapStats->pInfos[pMapStats->GetMapInfo(v15)].pName);//Войти в ^Pv[%s]
+    pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Transition, 0, sHouseName.data());
+    if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
+      pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
+    if ( IndoorLocation::GetLocationIndex(pLocationName) )
+      uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
+    return;
   }
-  v21 = pGlobalTXT_LocalizationStrings[73];
-LABEL_19:
-  strcpy(sHouseName.data(), v21);
-LABEL_20:
+  strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[73]);//Войти
   pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Transition, 0, sHouseName.data());
-  //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_C) )
-  if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
-    PlayHouseSound(anim_id, HouseSound_Greeting);
+  //if ( pAnimatedRooms[p2DEvents[anim_id].uAnimationID].uRoomSoundId )
+    //PlayHouseSound(anim_id, HouseSound_Greeting);
   if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
     pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
-  if ( v23 )
-    uCurrentHouse_Animation = v23;
+  if ( IndoorLocation::GetLocationIndex(pLocationName) )
+    uCurrentHouse_Animation = IndoorLocation::GetLocationIndex(pLocationName);
 }
 
 
@@ -107,10 +108,8 @@
 //----- (00444C8F) --------------------------------------------------------
 void TravelUI_Load()
 {
-  //signed int v0; // eax@1
   unsigned int v1; // eax@6
   GUIWindow *result; // eax@9
-  //const char *v3; // [sp-4h] [bp-2Ch]@2
   char pContainer[32]; // [sp+0h] [bp-28h]@1
 
   pEventTimer->Pause();
--- a/mm7_4.cpp	Mon Sep 30 11:41:55 2013 +0600
+++ b/mm7_4.cpp	Mon Sep 30 17:29:27 2013 +0600
@@ -2715,27 +2715,22 @@
 
 
 //----- (004B1447) --------------------------------------------------------
-Player *__fastcall sub_4B1447_party_fine(int a1, int a2, int a3)
+void sub_4B1447_party_fine(int a1, int a2, int a3)
 {
   signed int v3; // esi@1
   char v4; // sf@8
   int v5; // eax@8
   unsigned __int64 v6; // qax@12
   DDM_DLV_Header *v7; // eax@14
-  Player **v8; // edi@18
-  Player *result; // eax@19
-  //char *v10; // esi@20
 
   v3 = 0;
   if ( a2 )
   {
-    if ( a2 != 1 )
-    {
-      if ( a2 == 2 )
-        v3 = 2;
+    if ( a2 == 1 )
+      v3 = 2;
+    if ( a2 == 2 )
+      v3 = 2;
       goto LABEL_13;
-    }
-    v3 = 2;
   }
   else
   {
@@ -2768,22 +2763,14 @@
     if ( v7->uReputation > 10000 )
       v7->uReputation = 10000;
   }
-  v8 = &pPlayers[1];
-  do
+  for ( uint i = 1; i <= 4; ++i )
   {
-    result = *v8;
     if ( pParty->uFine )
     {
-      //v10 = result->_guilds_member_bits;
-      result = (Player *)_449B57_test_bit((unsigned __int8 *)result->_achieved_awards_bits, 1);
-      if ( !(short)result )
-		  __debugbreak();
-        //result = (Player *)_449B7E_toggle_bit((unsigned char *)v10, 1, 1u);
+      if ( !_449B57_test_bit(pPlayers[i]->_achieved_awards_bits, 1) )
+        _449B7E_toggle_bit(pPlayers[i]->_achieved_awards_bits, 1, 1);
     }
-    ++v8;
   }
-  while ( (signed int)v8 <= (signed int)&pPlayers[4] );
-  return result;
 }
 
 //----- (004B1523) --------------------------------------------------------
--- a/mm7_5.cpp	Mon Sep 30 11:41:55 2013 +0600
+++ b/mm7_5.cpp	Mon Sep 30 17:29:27 2013 +0600
@@ -2336,7 +2336,7 @@
                 }
               }
             }
-            pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
             v73 = "Can't jump to that location!";
           }
           ShowStatusBarString(v73, 6u);
@@ -3380,11 +3380,9 @@
           pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0);
           break;
         case UIMSG_PlayerCreationSelectActiveSkill:
-          pPlayer = &pPlayer[uPlayerCreationUI_SelectedCharacter];
-          v6 = pPlayer->GetSkillIdxByOrder(pParam + 4);
-          if ( pPlayer->GetSkillIdxByOrder(3) == 37 )
-            pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1;
-          pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0);
+          if ( pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(3) == 37 )
+            pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pParam + 4)] = 1;
+          pAudioPlayer->PlaySound(SOUND_24, 0, 0, -1, 0, 0, 0, 0);
           break;
         case UIMSG_PlayerCreationSelectClass:
           pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)pParam);
@@ -3402,14 +3400,14 @@
           pParty->Reset();
           break;
         case UIMSG_PlayerCreationRemoveUpSkill:
-          uPlayerCreationUI_SelectedCharacter = pParam;
           v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
-          //int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem;
-          v41 = 2;
-          v5 = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
-          pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5;
-          pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41)
-                                         + 3486 * uPlayerCreationUI_SelectedCharacter] = 0;
+          pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
+          pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(2)] = 0;
+          break;
+        case UIMSG_PlayerCreationRemoveDownSkill:
+          v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
+          pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
+          pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(3)] = 0;
           break;
         case UIMSG_PlayerCreationChangeName:
           pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0);
@@ -3567,14 +3565,6 @@
             //VideoPlayer::dtor();
           }
           break;
-        case UIMSG_PlayerCreationRemoveDownSkill:
-          uPlayerCreationUI_SelectedCharacter = pParam;
-          //__debugbreak();
-          pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7
-             + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
-          pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3)
-                                             + 3486 * uPlayerCreationUI_SelectedCharacter] = 0;
-          break;
         default:
           break;
       }
--- a/mm7_data.h	Mon Sep 30 11:41:55 2013 +0600
+++ b/mm7_data.h	Mon Sep 30 17:29:27 2013 +0600
@@ -1272,7 +1272,7 @@
 struct _DIG_DRIVER *Audio_GetFirstHardwareDigitalDriver(void);
 void PlayLevelMusic();
 unsigned int __fastcall sub_4B0E07(unsigned int uFaceID); // idb
-struct Player *__fastcall sub_4B1447_party_fine(int a1, int a2, int a3);
+void sub_4B1447_party_fine(int a1, int a2, int a3);
 void sub_4B1523(int *_this);
 void ShowPopupShopItem();
 void RestAndHeal(__int64 uNumMinutes); // idb