diff mm7_3.cpp @ 1525:863de6ec906b

Слияние
author Ritor1
date Thu, 05 Sep 2013 13:31:15 +0600
parents 53265d238d94 f3cd08b89476
children 7d986a396092
line wrap: on
line diff
--- a/mm7_3.cpp	Thu Sep 05 13:12:53 2013 +0600
+++ b/mm7_3.cpp	Thu Sep 05 13:31:15 2013 +0600
@@ -7190,40 +7190,25 @@
 }
 
 //----- (0044882F) --------------------------------------------------------
-void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName)
+void __fastcall SetDecorationSprite(uint16_t uCog, bool bHide, const char *pFileName)
 {
-  signed int v3; // ebp@1
-  char *v4; // esi@2
-  unsigned __int16 v5; // ax@6
-  unsigned int v6; // [sp+4h] [bp-8h]@1
-  int v7; // [sp+8h] [bp-4h]@1
-
-  v3 = 0;
-  v7 = a2;
-  v6 = uCog;
-  if ( (signed int)uNumLevelDecorations > 0 )
-  {
-    v4 = (char *)&pLevelDecorations[0].uFlags;
-    do
+  for (size_t i = 0; i < uNumLevelDecorations; i++)
+  {
+    if (pLevelDecorations[i].uCog == uCog)
     {
-      if ( *((_WORD *)v4 + 9) == v6 )
+      if (pFileName && strcmp(pFileName, "0"))
       {
-        if ( pFileName && _stricmp(pFileName, "0") )
-        {
-          v5 = pDecorationList->GetDecorIdByName(pFileName);
-          *((_WORD *)v4 - 1) = v5;
-          pDecorationList->InitializeDecorationSprite((signed __int16)v5);
-        }
-        if ( v7 )
-          *v4 &= 0xDFu;
-        else
-          *v4 |= 0x20u;
-        pParty->uFlags |= 2u;
+        pLevelDecorations[i].uDecorationDescID = pDecorationList->GetDecorIdByName(pFileName);
+        pDecorationList->InitializeDecorationSprite(pLevelDecorations[i].uDecorationDescID);
       }
-      ++v3;
-      v4 += 32;
+
+      if (bHide)
+        pLevelDecorations[i].uFlags &= ~LEVEL_DECORATION_INVISIBLE;
+      else
+        pLevelDecorations[i].uFlags |= LEVEL_DECORATION_INVISIBLE;
+
+      pParty->uFlags |= 2u;
     }
-    while ( v3 < (signed int)uNumLevelDecorations );
   }
 }
 
@@ -7580,7 +7565,7 @@
         pParty->vPosition.z = _5B65B0_npcdata_rep_or_other;
         pParty->uFallStartY = _5B65B0_npcdata_rep_or_other;
       }
-      if ( _5B65B4_npcdata_loword_house_or_other )
+      if ( _5B65B4_npcdata_loword_house_or_other != -1 )
         pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
       if ( _5B65B8_npcdata_hiword_house_or_other )
         pParty->sRotationX = _5B65B8_npcdata_hiword_house_or_other;