diff mm7_4.cpp @ 720:05f7a11f4f20

Слияние
author Ritor1
date Tue, 19 Mar 2013 23:41:29 +0600
parents a5ee769b02c6 ef4d646d738d
children f39d5902c85a
line wrap: on
line diff
--- a/mm7_4.cpp	Tue Mar 19 23:41:14 2013 +0600
+++ b/mm7_4.cpp	Tue Mar 19 23:41:29 2013 +0600
@@ -1947,8 +1947,8 @@
   for ( i = v3; fgets(&Buf, 490, i); i = File )
   {
     *strchr(&Buf, 10) = 0;
-    memcpy(&v84, texture_frame_table_txt_parser(&Buf, &v85), sizeof(v84));
-    if ( v84.field_0 && *v84.pProperties[0] != 47 )
+    memcpy(&v84, txt_file_frametable_parser(&Buf, &v85), sizeof(v84));
+    if ( v84.uPropCount && *v84.pProperties[0] != 47 )
       ++v4;
   }
   v2->uNumTiles = v4;
@@ -1964,8 +1964,8 @@
     while ( 1 )
     {
       *strchr(&Buf, 10) = 0;
-      memcpy(&v84, texture_frame_table_txt_parser(&Buf, &v85), sizeof(v84));
-      if ( v84.field_0 )
+      memcpy(&v84, txt_file_frametable_parser(&Buf, &v85), sizeof(v84));
+      if ( v84.uPropCount )
       {
         if ( *v84.pProperties[0] != 47 )
           break;
@@ -2196,7 +2196,7 @@
     {
       LOBYTE(v2->pTiles[v2->uNumTiles].uSection) = -1;
 LABEL_152:
-      for ( j = 5; j < v84.field_0; ++j )
+      for ( j = 5; j < v84.uPropCount; ++j )
       {
         v72 = v84.pProperties[j];
         if ( _strcmpi(v84.pProperties[j], "TTattr_Burn") )
@@ -4430,10 +4430,10 @@
     do
     {
       *strchr(&Buf, 10) = 0;
-      memcpy(&v24, texture_frame_table_txt_parser(&Buf, &v23), sizeof(v24));
-      if ( v24.field_0 && *v24.pProperties[0] != 47 )
-      {
-        if ( v24.field_0 < 3 )
+      memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24));
+      if ( v24.uPropCount && *v24.pProperties[0] != 47 )
+      {
+        if ( v24.uPropCount < 3 )
           Abortf("PlayerFrameTable::load, too few arguments, %s line %i.", Args, v26);
         ++v25;
       }
@@ -4453,8 +4453,8 @@
   for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
   {
     *strchr(&Buf, 10) = 0;
-    memcpy(&v24, texture_frame_table_txt_parser(&Buf, &v23), sizeof(v24));
-    if ( v24.field_0 && *v24.pProperties[0] != 47 )
+    memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24));
+    if ( v24.uPropCount && *v24.pProperties[0] != 47 )
     {
       v8 = atoi(v24.pProperties[0]);
       v9 = v24.pProperties[1];
@@ -4465,7 +4465,7 @@
       v2->pFrames[v2->uNumFrames].uAnimTime = atoi(v11);
       v2->pFrames[v2->uNumFrames].uAnimLength = 0;
       v2->pFrames[v2->uNumFrames].uFlags = 0;
-      for ( j = 3; j < v24.field_0; ++j )
+      for ( j = 3; j < v24.uPropCount; ++j )
       {
         if ( !_strcmpi(v24.pProperties[j], "New") )
         {
@@ -4668,9 +4668,9 @@
     {
       *strchr(&Buf, 10) = 0;
       memcpy(&v20, frame_table_txt_parser(&Buf, &v19), sizeof(v20));
-      if ( v20.field_0 && *v20.pProperties[0] != 47 )
-      {
-        if ( v20.field_0 < 3 )
+      if ( v20.uPropCount && *v20.pProperties[0] != 47 )
+      {
+        if ( v20.uPropCount < 3 )
           Abortf("IconFrameTable::loadText, too few arguments, %s line %i.", Args, v22);
         ++v21;
       }
@@ -4691,7 +4691,7 @@
     {
       *strchr(&Buf, 10) = 0;
       memcpy(&v20, frame_table_txt_parser(&Buf, &v19), sizeof(v20));
-      if ( v20.field_0 && *v20.pProperties[0] != 47 )
+      if ( v20.uPropCount && *v20.pProperties[0] != 47 )
       {
         strcpy(v2->pIcons[v2->uNumIcons].pAnimationName, v20.pProperties[0]);
         strcpy(v2->pIcons[v2->uNumIcons].pTextureName, v20.pProperties[1]);
@@ -11052,6 +11052,7 @@
   unsigned __int8 v9; // zf@16
   char v10; // sf@16
   unsigned __int8 v11; // of@16
+  bool test;
 
   auto a2 = _2da_idx;
   //v2 = p2DEvents_minus1___00[26 * a2];
@@ -11062,46 +11063,84 @@
   if ( (v2 != 4 || (signed int)v3 < 740 || (signed int)v3 > 771)
     && ((signed int)v3 >= 600 || (signed int)v3 >= 529 && (signed int)v3 <= 599) || a1->Stolen())
     return 0;
-  v6 = v2 - 1;
-  if ( !v6 )
+  switch( p2DEvents[a2 - 1].uType )
+  {
+	case BildingType_WeaponShop:
+		{
+		test = v5 <= 2;
+		break;
+		}
+	case BildingType_ArmorShop:
+		{
+		test = v5 >= 3;
+		break;
+		}
+	case BildingType_MagicShop:
+		{
+		test = pItemsTable->pItems[v4].uSkillType == 38 || v5 == 16;
+		break;
+		}
+	case BildingType_AlchemistShop:
+		{
+		__debugbreak(); // need to test
+		test = v5 == 13 || v5 == 14 || (v5 > 14 && !(v5 != 17 || (signed int)v3 < 740) && v3 != 771);
+		break;
+		}
+	default:
+		{
+		test = 0;
+		break;
+		}
+  }
+
+  return test;
+/*
+  if ( p2DEvents[a2 - 1].uType == 1 )
   {
     v11 = __OFSUB__(v5, 2);
     v9 = v5 == 2;
     v10 = v5 - 2 < 0;
     goto LABEL_23;
   }
-  v7 = v6 - 1;
-  if ( v7 )
-  {
-    v8 = v7 - 1;
-    if ( !v8 )
+  if ( p2DEvents[a2 - 1].uType > 2 )
+  {
+    if ( p2DEvents[a2 - 1].uType == 3 )
     {
       if ( pItemsTable->pItems[v4].uSkillType != 38 )
         return v5 == 16;
       return 1;
     }
-    if ( v8 != 1 || v5 < 13 )
+    if ( p2DEvents[a2 - 1].uType != 4 || v5 < 13 )
       return 0;
-    if ( v5 <= 14 )
-      return 1;
-    if ( v5 != 17 || (signed int)v3 < 740 )
-      return 0;
-    v11 = __OFSUB__(v3, 771);
-    v9 = v3 == 771;
-    v10 = ((v3 - 771) & 0x80000000u) != 0;
+	if ( p2DEvents[a2 - 1].uType == 4)
+	{
+		if ( v5 < 13 )
+		  return 0;
+		if ( v5 <= 14 )
+		  return 1;
+		if ( v5 != 17 || (signed int)v3 < 740 )
+		  return 0;
+		v11 = __OFSUB__(v3, 771);
+		v9 = v3 == 771;
+		v10 = ((v3 - 771) & 0x80000000u) != 0;
 LABEL_23:
-    if ( !((unsigned __int8)(v10 ^ v11) | v9) )
-      return 0;
-    return 1;
-  }
-  if ( v5 >= 3 )
-  {
-    v11 = __OFSUB__(v5, 9);
-    v9 = v5 == 9;
-    v10 = v5 - 9 < 0;
-    goto LABEL_23;
+		if ( !((unsigned __int8)(v10 ^ v11) | v9) )
+		  return 0;
+		return 1;
+	}
+  }
+  if ( p2DEvents[a2 - 1].uType == 2 )
+  {
+	  if ( v5 >= 3 )
+	  {
+		v11 = __OFSUB__(v5, 9);
+		v9 = v5 == 9;
+		v10 = v5 - 9 < 0;
+		goto LABEL_23;
+	  }
   }
   return 0;
+*/
 }