changeset 537:db4631a484ae

m
author Ritor1
date Sat, 02 Mar 2013 08:59:10 +0600
parents 55d0794848d1
children 1d876589a030
files Chest.cpp Chest.h MM7.vcxproj.filters
diffstat 3 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Chest.cpp	Sat Mar 02 00:24:27 2013 +0600
+++ b/Chest.cpp	Sat Mar 02 08:59:10 2013 +0600
@@ -89,7 +89,7 @@
   //v1 = (char *)&pChests[uChestID].uFlags;
   //v34 = v1;
   if (!chest->Initialized())
-    Chest::_420284(uChestID);
+    Chest::PlacementItems(uChestID);
 
   if ( !uActiveCharacter )
     return 0;
@@ -294,8 +294,7 @@
       if ( v6 > 0 )
       {
         v17 = v18 + 32 * v23 / v19;
-        v7 = pIcons_LOD->LoadTexture(
-               pItemsTable->pItems[*(int *)((char *)&pOtherOverlayList->pOverlays[49].field_4 + 36 * v6 + v3 * 5324)].pIconName,
+        v7 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)((char *)&pChests[v3].mm7__vector_pItems[v6 - 1].uItemID)].pIconName,
                TEXTURE_16BIT_PALETTE);
         v8 = (Texture *)(v7 != -1 ? &pIcons_LOD->pTextures[v7] : 0);
         v9 = (v7 != -1 ? pIcons_LOD->pTextures[v7].uTextureWidth : 24);
@@ -616,7 +615,7 @@
 // 506128: using guessed type int areWeLoadingTexture;
 
 //----- (00420284) --------------------------------------------------------
-char *Chest::_420284(unsigned int uChestID)
+char *Chest::PlacementItems(unsigned int uChestID)
 {
   int v1; // ebx@1
   unsigned int v2; // esi@1
@@ -662,7 +661,7 @@
     do
     {
 	  v9 = v12->uItemID;
-      if ( v9 > 0 )
+      if ( v9 )
       {
         v6 = 0;
         while ( !Chest::CanPlaceItemAt((unsigned __int8)Dst[v6], v9, v10) )
@@ -671,7 +670,7 @@
           if ( v6 >= uChestArea )
             break;
         }
-		if(v6<uChestArea)
+		if(v6 < uChestArea)
 		{
 			Chest::PlaceItemAt((unsigned __int8)Dst[v6], v11, v10);
 			if ( pChests[v3].uFlags & 4 )
--- a/Chest.h	Sat Mar 02 00:24:27 2013 +0600
+++ b/Chest.h	Sat Mar 02 08:59:10 2013 +0600
@@ -57,7 +57,7 @@
   static int _41FF64(unsigned int uChestID);
   static int _41FFA2(int a1, ItemGen *a2, unsigned int uChestID);
   static unsigned int PlaceItemAt(unsigned int a1, unsigned int uItemIdx, unsigned int uChestID);
-  static char *_420284(unsigned int uChestID);
+  static char *PlacementItems(unsigned int uChestID);
   static bool Open(unsigned int uChestID);
   static void DrawChestUI(unsigned int uChestID);
   static void ToggleFlag(unsigned int uChestID, unsigned __int16 uFlag, unsigned int bToggle);
--- a/MM7.vcxproj.filters	Sat Mar 02 00:24:27 2013 +0600
+++ b/MM7.vcxproj.filters	Sat Mar 02 08:59:10 2013 +0600
@@ -127,7 +127,6 @@
     <ClInclude Include="mm7_data.h" />
     <ClInclude Include="Allocator.h" />
     <ClInclude Include="IndoorCamera.h" />
-    <ClInclude Include="LayingItem.h" />
     <ClInclude Include="Viewport.h" />
     <ClInclude Include="MapInfo.h" />
     <ClInclude Include="PlayerFrameTable.h" />
@@ -202,6 +201,7 @@
     <ClInclude Include="resource.h" />
     <ClInclude Include="stru346.h" />
     <ClInclude Include="texts.h" />
+    <ClInclude Include="SpriteObject.h" />
   </ItemGroup>
   <ItemGroup>
     <Filter Include="lib">
@@ -258,7 +258,6 @@
     <ClCompile Include="stru6.cpp" />
     <ClCompile Include="AudioPlayer.cpp" />
     <ClCompile Include="GUIButton.cpp" />
-    <ClCompile Include="LayingItem.cpp" />
     <ClCompile Include="VideoPlayer.cpp" />
     <ClCompile Include="GUIProgressBar.cpp" />
     <ClCompile Include="TileFrameTable.h" />
@@ -321,6 +320,7 @@
     <ClCompile Include="texts.cpp" />
     <ClCompile Include="mm7text_ru.cpp" />
     <ClCompile Include="NPC.cpp" />
+    <ClCompile Include="SpriteObject.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="Might and Magic Trilogy.rc" />