diff mm7_1.cpp @ 583:a436924b31c3

CharacterUI_AwardsTab_Draw goto clean
author zipi
date Wed, 06 Mar 2013 10:59:51 +0000
parents f54481c85df8
children 6a36b1cd767e
line wrap: on
line diff
--- a/mm7_1.cpp	Wed Mar 06 16:51:39 2013 +0600
+++ b/mm7_1.cpp	Wed Mar 06 10:59:51 2013 +0000
@@ -664,24 +664,23 @@
   {
     result += awards_count;
     dword_506528 = result;
-    if ( (signed int)(awards_count + result) <= awards_count2 )
-      goto LABEL_14;
-    result = awards_count2 - awards_count;
-    goto LABEL_13;
+    if ( (signed int)(awards_count + result) > awards_count2 )
+	{
+		result = awards_count2 - awards_count;
+		dword_506528 = result;
+	}
   }
-  if ( dword_50651C > 0 )
+  else if ( dword_50651C > 0 )
   {
     result -= awards_count;
     dword_506528 = result;
     if ( (result & 0x80000000u) != 0 )
     {
       result = 0;
-LABEL_13:
       dword_506528 = result;
-      goto LABEL_14;
     }
   }
-LABEL_14:
+//LABEL_14:
   dword_506544 = 0;
   dword_506548 = 0;
   awards_count = 0;
@@ -695,12 +694,71 @@
       v20 = achievedAwardsIndex[v21];
       v6 = (char *)pAwards[v20].pText;//(char *)dword_723E80_award_related[v20 / 4];
       if ( v5 != 1 )
-        break;
-      v17 = pParty->uFine;
-LABEL_42:
-      sprintf(pTmpBuf, v6, v17);
-      v6 = pTmpBuf;
-LABEL_43:
+	  {
+		if (!( (v5 < 85 || v5 > 91) && (v5 < 103 || v5 > 104) ))
+		{
+			if ( v5 > 89 )
+			{
+			  if ( v5 == 90 )
+			  {
+				v10 = (unsigned __int8)pParty->uNumArenaKnightWins;
+				v22 = v10;
+			  }
+			  else if ( v5 == 91 )
+			  {
+				v10 = (unsigned __int8)pParty->uNumArenaLordWins;
+				v22 = v10;
+			  }
+			  else if ( v5 == 103 )
+			  {
+				v10 = pParty->field_874;
+				v22 = v10;
+			  }
+			  else if ( v5 == 104 )
+			  {
+				v10 = pParty->field_878;
+				v22 = v10;
+			  }
+			}
+			else
+			{
+			  if ( v5 == 89 )
+			  {
+				v10 = (unsigned __int8)pParty->uNumArenaSquireWins;
+				v22 = v10;
+			  }
+			  else if ( v5 == 85 )
+			  {
+				v10 = pParty->uNumDeaths;
+				v22 = v10;
+			  }
+			  else if ( v5 == 86 )
+			  {
+				v10 = pParty->uNumBountiesCollected;
+				v22 = v10;
+			  }
+			  else if ( v5 == 87 )
+			  {
+				v10 = pParty->uNumPrisonTerms;
+				v22 = v10;
+			  }
+			  else if ( v5 == 88)
+			  {
+				v10 = (unsigned __int8)pParty->uNumArenaPageWins;
+				v22 = v10;
+			  }
+			}
+			v17 = v22;
+			sprintf(pTmpBuf, v6, v17);
+			v6 = pTmpBuf;
+		}
+	  }
+	  else
+	  {
+        v17 = pParty->uFine;
+        sprintf(pTmpBuf, v6, v17);
+        v6 = pTmpBuf;
+	  }
 	  v14 = pAwards[v20].uSort;//dword_723E84[v20 / 4];
       ++awards_count;
       v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(
@@ -720,70 +778,7 @@
       }
       return;
     }
-    if ( (v5 < 85 || v5 > 91) && (v5 < 103 || v5 > 104) )
-      goto LABEL_43;
-    if ( v5 > 89 )
-    {
-      v11 = v5 - 90;
-      if ( !v11 )
-      {
-        v10 = (unsigned __int8)pParty->uNumArenaKnightWins;
-        goto LABEL_40;
-      }
-      v12 = v11 - 1;
-      if ( !v12 )
-      {
-        v10 = (unsigned __int8)pParty->uNumArenaLordWins;
-        goto LABEL_40;
-      }
-      v13 = v12 - 12;
-      if ( !v13 )
-      {
-        v10 = pParty->field_874;
-        goto LABEL_40;
-      }
-      if ( v13 == 1 )
-      {
-        v10 = pParty->field_878;
-        goto LABEL_40;
-      }
-    }
-    else
-    {
-      if ( v5 == 89 )
-      {
-        v10 = (unsigned __int8)pParty->uNumArenaSquireWins;
-        goto LABEL_40;
-      }
-      v7 = v5 - 85;
-      if ( !v7 )
-      {
-        v10 = pParty->uNumDeaths;
-        goto LABEL_40;
-      }
-      v8 = v7 - 1;
-      if ( !v8 )
-      {
-        v10 = pParty->uNumBountiesCollected;
-        goto LABEL_40;
-      }
-      v9 = v8 - 1;
-      if ( !v9 )
-      {
-        v10 = pParty->uNumPrisonTerms;
-        goto LABEL_40;
-      }
-      if ( v9 == 1 )
-      {
-        v10 = (unsigned __int8)pParty->uNumArenaPageWins;
-LABEL_40:
-        v22 = v10;
-        goto LABEL_41;
-      }
-    }
-LABEL_41:
-    v17 = v22;
-    goto LABEL_42;
+
   }
   return;
 }
@@ -2479,23 +2474,24 @@
         if (item_desc->uDamageDice) //"Armor"	
           sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod);
       break;
-      
+      case EQUIP_POTION:
+          if ( inspect_item->uEncantmentType )
+              sprintf(out_text + 200,  "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEncantmentType); //"Power"
+          break;
+      case EQUIP_REAGENT:
+         sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power"
+         break;
     }
 
     if ( v77 )
       goto LABEL_65;
-    if  (item_desc->uEquipType==EQUIP_POTION)
-        {        
-        if ( inspect_item->uEnchantmentType )
-            sprintf(out_text + 200,  "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power"
-        }
-    else if  (item_desc->uEquipType== EQUIP_REAGENT)
-        {sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power"
-        }
-    else if ( inspect_item->uEnchantmentType )
+    //v23 = item_desc->uEquipType;
+    
+
+    if ( inspect_item->uEncantmentType )
      {
         sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210],
-             pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special"
+             pItemsTable->pEnchantments[inspect_item->uEncantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special"
     }
     else  if ( inspect_item->uSpecEnchantmentType )
       {      
@@ -2536,7 +2532,7 @@
         wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54;
         if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight )
             wHintWindow.uFrameHeight = (unsigned int)Str;
-        if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) )
+        if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) )
             wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight);
         v85 = 0;
         if ( pFontArrus->uFontHeight )
@@ -2604,7 +2600,7 @@
                 }
             else
                 {
-                if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) )
+                if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) )
                     {
                     sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed);
                     strcpy(pTmpBuf, "Duration:");