diff Player.cpp @ 1424:5930342f092b

fall to the water
author Ritor1
date Tue, 30 Jul 2013 15:14:46 +0600
parents 2423bc2af692
children 71a2cf416478 2489c8aeac90
line wrap: on
line diff
--- a/Player.cpp	Tue Jul 30 09:34:14 2013 +0600
+++ b/Player.cpp	Tue Jul 30 15:14:46 2013 +0600
@@ -8737,49 +8737,52 @@
   Player *v2; // edx@3
   int v3; // ecx@3
   Player **pPlayers; // esi@8
-  unsigned int v5; // ecx@8
+  //bool item_flag;
   Player *v6; // edx@9
 
-  if ( a1 < 1 || a1 > 4 )
-  {
-    if ( !a1 )
-    {
-      pPlayers = &::pPlayers[1];
-      v5 = 604;
-      while ( 1 )
-      {
-        result = Player_has_item(v5, *pPlayers, 0);
-        if ( !result )
-          break;
-        __debugbreak(); // player.cpp(8748): warning C4700: uninitialized local variable 'v6' used
-        result = v6->pEquipment.uArmor;
-        if ( !result )
-          break;
-        result *= 9;
-        if ( *(int *)&v6->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v5 )
-          break;
-        ++pPlayers;
-        if ( (signed int)pPlayers >= (signed int)&qword_A750D8 )
-          goto LABEL_13;
-      }
-    }
-    goto LABEL_6;
-  }
-  result = Player_has_item(604u, ::pPlayers[a1], 0);
-  __debugbreak(); // player.cpp(8764): warning C4700: uninitialized local variable 'v2' used
-  __debugbreak(); // player.cpp(8764): warning C4700: uninitialized local variable 'v3' used
-  if ( !result
-    || (result = v2->pEquipment.uArmor) == 0
-    || (result *= 9, *(int *)&v2->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v3) )
-  {
-LABEL_6:
-    LOBYTE(result) = 0;
-    return result;
-  }
-LABEL_13:
-  LOBYTE(result) = 1;
-  return result;
-}
+  //if ( a1 < 1 || a1 > 4 )
+  //{
+    //if ( !a1 )
+    //{
+      //pPlayers = &::pPlayers[1];
+      //v5 = 604;
+      //while ( 1 )
+  assert ( a1 > 0 && a1 < 5 );
+      for ( uint i = 1; i < (signed int)&qword_A750D8; ++i )
+      {
+        //item_flag = Player_has_item(604, *pPlayers, 0);
+        if ( !Player_has_item(604, ::pPlayers[i], 0) )
+          return false;
+        //__debugbreak(); // player.cpp(8748): warning C4700: uninitialized local variable 'v6' used
+        //result = ::pPlayers[i]->pEquipment.uArmor;
+        if ( !::pPlayers[i]->pEquipment.uArmor )
+          return false;
+        //result *= 9;
+        if ( *(int *)&::pPlayers[i]->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * 9 + 5] != 604 )
+          return false;
+        //++pPlayers;
+        //if ( (signed int)pPlayers >= (signed int)&qword_A750D8 )
+          //return true;
+      }
+      return true;
+    }
+    //return false;
+  //}
+  //result = Player_has_item(604u, ::pPlayers[a1], 0);
+  //__debugbreak(); // player.cpp(8764): warning C4700: uninitialized local variable 'v2' used
+  //__debugbreak(); // player.cpp(8764): warning C4700: uninitialized local variable 'v3' used
+  //if ( !result
+  //  || (result = v2->pEquipment.uArmor) == 0
+  //  || (result *= 9, *(int *)&v2->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v3) )
+  //{
+//LABEL_6:
+    //LOBYTE(result) = 0;
+   // return false;
+  //}
+//LABEL_13:
+  //LOBYTE(result) = 1;
+  //return true;
+//}
 //----- (0043EE15) --------------------------------------------------------
 bool __fastcall Player_has_item(unsigned int uItemID, Player *pPlayer, char a3)
 {