changeset 535:426682cf4a75

m
author Ritor1
date Sat, 02 Mar 2013 00:24:12 +0600
parents 69ef7c749e18
children 55d0794848d1
files Chest.cpp
diffstat 1 files changed, 7 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/Chest.cpp	Fri Mar 01 22:04:13 2013 +0600
+++ b/Chest.cpp	Sat Mar 02 00:24:12 2013 +0600
@@ -79,7 +79,7 @@
 
   //a4 = uChestID;
   assert(uChestID < 20);
-  auto chest = pChests + uChestID;
+  auto chest = &pChests[uChestID];
 
   ++pIcons_LOD->uTexturePacksCount;
   if (!pIcons_LOD->uNumPrevLoadedFiles)
@@ -220,7 +220,7 @@
     }
     pIcons_LOD->_4114F2();
     dword_507CD8 = 0;
-    return 0;
+    return false;
   }
   chest->SetInitialized(false);//*v1 &= 0xFEu;
   sRotY = 1;
@@ -233,26 +233,15 @@
       pPlayers[uActiveCharacter]->PlaySound(SPEECH_4, 0);
   }
   dword_507CD8 = 0;
-  v3 = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Chest, a4, 0);
+  v3 = GUIWindow::Create(0, 0, 640, 480, WINDOW_Chest, uChestID, 0);
   pGUIWindow_CurrentMenu = v3;
   pChestWindow = v3;
-  pBtn_ExitCancel = v3->CreateButton(
-                 0x1D7u,
-                 0x1BDu,
-                 0xA9u,
-                 0x23u,
-                 1,
-                 0,
-                 0x71u,
-                 0,
-                 0,
-                 pGlobalTXT_LocalizationStrings[79],// Exit
-                 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
-                 0);
+  pBtn_ExitCancel = v3->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[79],// Exit
+                 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0);
   pChestWindow->CreateButton(7u, 8u, 460u, 343u, 1, 0, 0xCu, 0, 0, "", 0);
   pCurrentScreen = SCREEN_CHEST;
   pEventTimer->Pause();
-  return 1;
+  return true;
 }
 
 //----- (0042092D) --------------------------------------------------------
@@ -673,7 +662,7 @@
     do
     {
 	  v9 = v12->uItemID;
-      if ( v9 )
+      if ( v9 > 0 )
       {
         v6 = 0;
         while ( !Chest::CanPlaceItemAt((unsigned __int8)Dst[v6], v9, v10) )