diff mm7_6.cpp @ 1423:350959f13283

Слияние
author Ritor1
date Tue, 30 Jul 2013 09:34:14 +0600
parents 9a1adf08f4ed
children 27b7ee003c7c
line wrap: on
line diff
--- a/mm7_6.cpp	Tue Jul 30 09:33:52 2013 +0600
+++ b/mm7_6.cpp	Tue Jul 30 09:34:14 2013 +0600
@@ -127,7 +127,20 @@
         {
           v11 = 0;
           v12 = *(float *)v4 == *((float *)v7 - 5);
-          goto LABEL_19;
+          if ( ! (v12 | v11) )
+		  {
+			  v26 += 48;
+			  ++v24;
+			  v25 += 48;
+			  v27 += 48;
+			  v28 += 48;
+			  v5 += 48;
+			  v4 += 48;
+			  ++v22;
+			  v23 += 48;
+			  v21 = v5;
+			  v20 = v4;
+		  }
         }
       }
       else
@@ -136,13 +149,22 @@
         {
           v11 = 0;
           v12 = *(float *)v4 == *((float *)v7 + 7);
-LABEL_19:
-          if ( v12 | v11 )
-            goto LABEL_21;
-          goto LABEL_20;
+          if ( !(v12 | v11) )
+		  {
+			  v26 += 48;
+			  ++v24;
+			  v25 += 48;
+			  v27 += 48;
+			  v28 += 48;
+			  v5 += 48;
+			  v4 += 48;
+			  ++v22;
+			  v23 += 48;
+			  v21 = v5;
+			  v20 = v4;
+		  }
         }
       }
-LABEL_20:
       v26 += 48;
       ++v24;
       v25 += 48;
@@ -155,7 +177,6 @@
       v21 = v5;
       v20 = v4;
     }
-LABEL_21:
     if ( v19 )
     {
       v13 = v24;
@@ -328,28 +349,34 @@
   v14 = 0;
   if ( v3 )
   {
-    if ( !pActor->pMonsterInfo.uTreasureDiceRolls )
-      goto LABEL_9;
-    do
-    {
-      ++v2;
-      v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1;
-    }
-    while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls );
+    if ( pActor->pMonsterInfo.uTreasureDiceRolls )
+	{
+		do
+		{
+		  ++v2;
+		  v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1;
+		}
+		while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls );
+		if ( v14 )
+		{
+		  party_finds_gold(v14, 0);
+		  viewparams->bRedrawGameUI = 1;
+		}
+	}
   }
   else
   {
-    if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType != 18 )
-      goto LABEL_9;
-    v14 = pActor->array_000234[3].uSpecEnchantmentType;
-    pActor->array_000234[3].Reset();
+    if ( pItemsTable->pItems[pActor->array_000234[3].uItemID].uEquipType == 18 )
+	{
+		v14 = pActor->array_000234[3].uSpecEnchantmentType;
+		pActor->array_000234[3].Reset();
+		if ( v14 )
+		{
+		  party_finds_gold(v14, 0);
+		  viewparams->bRedrawGameUI = 1;
+		}
+	}
   }
-  if ( v14 )
-  {
-    party_finds_gold(v14, 0);
-    viewparams->bRedrawGameUI = 1;
-  }
-LABEL_9:
   if ( pActor->uCarriedItemID )
   {
     Dst.Reset();
@@ -394,7 +421,6 @@
       }
       pActor->array_000234[1].Reset();
     }
-LABEL_55:
     pActor->Remove();
     return;
   }
@@ -455,7 +481,9 @@
     pActor->array_000234[1].Reset();
   }
   if ( !v13 || rand() % 100 < 90 )
-    goto LABEL_55;
+  {
+    pActor->Remove();
+  }
 }
 
 //----- (00426E10) --------------------------------------------------------
@@ -624,7 +652,7 @@
     }
     while ( v17 ^ v18 );
     if ( v2 )
-      goto LABEL_61;
+      return v23[rand() % v2];
   }
   v19 = 0;
   do
@@ -636,7 +664,6 @@
   }
   while ( v19 < 4 );
   if ( v2 )
-LABEL_61:
     result = v23[rand() % v2];
   else
     result = 0;
@@ -860,6 +887,8 @@
   {
     v14 = a4 + v9;
     v15 = ((v7 + 15) >> 1) + v7 + 15;
+	v13 = __OFSUB__(v14, v15);
+    v12 = v14 - v15 < 0;
   }
   else
   {
@@ -869,14 +898,15 @@
       v11 = v7 + 15;
       v13 = __OFSUB__(v10, v11);
       v12 = v10 - v11 < 0;
-      goto LABEL_16;
     }
-    v14 = a4 + v9;
-    v15 = 2 * v7 + 30;
+	else
+	{
+      v14 = a4 + v9;
+      v15 = 2 * v7 + 30;
+	  v13 = __OFSUB__(v14, v15);
+      v12 = v14 - v15 < 0;
+	}
   }
-  v13 = __OFSUB__(v14, v15);
-  v12 = v14 - v15 < 0;
-LABEL_16:
   if ( v12 ^ v13 )
     result = 0;
   else
@@ -981,25 +1011,29 @@
       break;
     case 0:
       v6 = pActor->pMonsterInfo.uResFire;
-      goto LABEL_12;
+      v4 = v5;
+      break;
     case 1:
       v6 = pActor->pMonsterInfo.uResAir;
-      goto LABEL_12;
+      v4 = v5;
+      break;
     case 2:
       v6 = pActor->pMonsterInfo.uResWater;
-      goto LABEL_12;
+      v4 = v5;
+      break;
     case 3:
       v6 = pActor->pMonsterInfo.uResEarth;
-      goto LABEL_12;
+      v4 = v5;
+      break;
     case 6:
       v6 = pActor->pMonsterInfo.uResSpirit;
       break;
     case 7:
       v6 = pActor->pMonsterInfo.uResMind;
-      goto LABEL_12;
+      v4 = v5;
+      break;
     case 8:
       v6 = pActor->pMonsterInfo.uResBody;
-LABEL_12:
       v4 = v5;
       break;
     case 9:
@@ -1050,52 +1084,41 @@
     case 0u:
       v3 = pActor;
       v4 = pActor->pMonsterInfo.uResFire;
-      goto LABEL_12;
     case 1u:
       v3 = pActor;
       v4 = pActor->pMonsterInfo.uResAir;
-      goto LABEL_12;
     case 2u:
       v3 = pActor;
       v4 = pActor->pMonsterInfo.uResWater;
-      goto LABEL_12;
     case 3u:
       v3 = pActor;
       v4 = pActor->pMonsterInfo.uResEarth;
-      goto LABEL_12;
     case 7u:
       v3 = pActor;
       v4 = pActor->pMonsterInfo.uResMind;
-      goto LABEL_12;
     case 6u:
       v3 = pActor;
       v4 = pActor->pMonsterInfo.uResSpirit;
-      goto LABEL_12;
     case 8u:
       v3 = pActor;
       v4 = pActor->pMonsterInfo.uResBody;
-      goto LABEL_12;
     case 9u:
       v3 = pActor;
       v4 = pActor->pMonsterInfo.uResLight;
-      goto LABEL_12;
     case 0xAu:
       v3 = pActor;
       v4 = pActor->pMonsterInfo.uResDark;
-      goto LABEL_12;
     case 4u:
       v3 = pActor;
       v4 = pActor->pMonsterInfo.uResPhysical;
-LABEL_12:
-      if ( v4 < 200 )
-        result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30;
-      else
-        result = 0;
       break;
     default:
-      result = 1;
-      break;
+      return 1;
   }
+  if ( v4 < 200 )
+	result = rand() % (signed int)(((unsigned int)v3->pMonsterInfo.uLevel >> 2) + v4 + 30) < 30;
+  else
+	result = 0;
   return result;
 }
 
@@ -1549,7 +1572,6 @@
   v13 = 0;
   if ( (signed int)uNumActors <= 0 )
   {
-LABEL_20:
     result = 0;
   }
   else
@@ -1597,7 +1619,7 @@
       ++v13;
       ++v1;
       if ( v13 >= (signed int)uNumActors )
-        goto LABEL_20;
+        return 0;
     }
     result = 1;
   }