changeset 1354:05becb008006

Player::_49327B to Player::ProfessionOrGuildFlagsCorrect, removed a huge section of the function that's never used (only 4 inputs used)
author Grumpy7
date Sat, 13 Jul 2013 13:12:21 +0200
parents 8f69f77a0067
children af2fc30d765f
files Player.cpp Player.h mm7_4.cpp
diffstat 3 files changed, 19 insertions(+), 207 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Sat Jul 13 12:35:02 2013 +0200
+++ b/Player.cpp	Sat Jul 13 13:12:21 2013 +0200
@@ -628,223 +628,35 @@
 }
 
 //----- (0049327B) --------------------------------------------------------
-int Player::_49327B(unsigned int uClass, int a3)
-{
-  Player *v3; // esi@1
-  char v4; // zf@4
-  __int16 v5; // dx@9
-  signed int result; // eax@84
-  unsigned int v7; // [sp-8h] [bp-10h]@3
-  int v8; // [sp-4h] [bp-Ch]@3
-
-  v3 = this;
+bool Player::GetProfessionOrGuildFlags( unsigned int uClass, int a3 )
+{
   if ( this->classType == uClass )
   {
-LABEL_84:
-    result = 1;
+    return true;
   }
   else
   {
+    if (!a3)
+    {
+      return false;
+    }
     switch ( uClass )
     {
-      case 0u:
-        v8 = a3;
-        v7 = 1;
-        goto LABEL_4;
-      case 1u:
-        if ( a3 && (unsigned __int16)_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 17)
-          || _49327B(2u, a3) )
-          goto LABEL_84;
-        v8 = a3;
-        v7 = 3;
-        goto LABEL_4;
-      case 2u:
-        v5 = 19;
-        goto LABEL_82;
-      case 3u:
-        v5 = 21;
-        goto LABEL_82;
-      case 4u:
-        v8 = a3;
-        v7 = 5;
-        goto LABEL_4;
-      case 5u:
-        if ( a3 && (unsigned __int16)_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 11)
-          || _49327B(6u, a3) )
-          goto LABEL_84;
-        v8 = a3;
-        v7 = 7;
-        goto LABEL_4;
-      case 6u:
-        if ( !a3 )
-          break;
-        v5 = 13;
-        goto LABEL_82;
-      case 7u:
-        if ( !a3 )
-          break;
-        v5 = 15;
-        goto LABEL_82;
-      case 8u:
-        v8 = a3;
-        v7 = 9;
-        goto LABEL_4;
-      case 9u:
-        if ( a3 && (unsigned __int16)_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 23)
-          || _49327B(0xAu, a3) )
-          goto LABEL_84;
-        v8 = a3;
-        v7 = 11;
-        goto LABEL_4;
-      case 0xAu:
-        if ( !a3 )
-          break;
-        v5 = 25;
-        goto LABEL_82;
-      case 0xBu:
-        if ( !a3 )
-          break;
-        v5 = 27;
-        goto LABEL_82;
-      case 0xCu:
-        v8 = a3;
-        v7 = 13;
-        goto LABEL_4;
-      case 0xDu:
-        if ( a3 && (unsigned __int16)_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 41)
-          || _49327B(0xEu, a3) )
-          goto LABEL_84;
-        v8 = a3;
-        v7 = 15;
-        goto LABEL_4;
-      case 0xEu:
-        if ( !a3 )
-          break;
-        v5 = 43;
-        goto LABEL_82;
-      case 0xFu:
-        if ( !a3 )
-          break;
-        v5 = 45;
-        goto LABEL_82;
-      case 0x10u:
-        v8 = a3;
-        v7 = 17;
-        goto LABEL_4;
-      case 0x11u:
-        if ( a3 && (unsigned __int16)_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 35)
-          || _49327B(0x12u, a3) )
-          goto LABEL_84;
-        v8 = a3;
-        v7 = 19;
-        goto LABEL_4;
-      case 0x12u:
-        if ( !a3 )
-          break;
-        v5 = 37;
-        goto LABEL_82;
-      case 0x13u:
-        v5 = 39;
-        goto LABEL_82;
-      case 0x14u:
-        v8 = a3;
-        v7 = 21;
-        goto LABEL_4;
-      case 0x15u:
-        if ( a3 && (unsigned __int16)_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 29)
-          || _49327B(0x16u, a3) )
-          goto LABEL_84;
-        v8 = a3;
-        v7 = 23;
-        goto LABEL_4;
-      case 0x16u:
-        if ( !a3 )
-          break;
-        v5 = 31;
-        goto LABEL_82;
-      case 0x17u:
-        if ( !a3 )
-          break;
-        v5 = 33;
-        goto LABEL_82;
-      case 0x18u:
-        if ( !_49327B(0x19u, a3) )
-          goto LABEL_56;
-        break;
-      case 0x19u:
-LABEL_56:
-        if ( a3 && (unsigned __int16)_449B57_test_bit((unsigned __int8 *)v3->_guilds_member_bits, 63)
-          || _49327B(0x1Au, a3) )
-          goto LABEL_84;
-        v8 = a3;
-        v7 = 27;
-        goto LABEL_4;
       case 0x1Au:
-        if ( !a3 )
-          break;
-        v5 = 65;
-        goto LABEL_82;
+        return(_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 65));
       case 0x1Bu:
-        if ( !a3 )
-          break;
-        v5 = 67;
-        goto LABEL_82;
-      case 0x1Cu:
-        v8 = a3;
-        v7 = 29;
-        goto LABEL_4;
-      case 0x1Du:
-        if ( a3 && (unsigned __int16)_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 69)
-          || _49327B(0x1Eu, a3) )
-          goto LABEL_84;
-        v8 = a3;
-        v7 = 31;
-        goto LABEL_4;
-      case 0x1Eu:
-        if ( !a3 )
-          break;
-        v5 = 71;
-        goto LABEL_82;
-      case 0x1Fu:
-        if ( !a3 )
-          break;
-        v5 = 73;
-        goto LABEL_82;
-      case 0x20u:
-        v8 = a3;
-        v7 = 33;
-        goto LABEL_4;
-      case 0x21u:
-        if ( a3 && (unsigned __int16)_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 73)
-          || _49327B(0x22u, a3) )
-          goto LABEL_84;
-        v8 = a3;
-        v7 = 35;
-LABEL_4:
-        v4 = _49327B(v7, v8) == 0;
-        goto LABEL_83;
+        return(_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 67));
       case 0x22u:
-        if ( !a3 )
-          break;
-        v5 = 77;
-        goto LABEL_82;
+        return(_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 77));
       case 0x23u:
-        if ( a3 )
-        {
-          v5 = 79;
-LABEL_82:
-          v4 = (unsigned __int16)_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, v5) == 0;
-LABEL_83:
-          if ( !v4 )
-            goto LABEL_84;
-        }
+        return(_449B57_test_bit((unsigned __int8 *)this->_guilds_member_bits, 79));
         break;
       default:
+        assert("Should not be able to get here" && false);
         break;
     }
-    result = 0;
-  }
-  return result;
+    return false;
+  }
 }
 
 
--- a/Player.h	Sat Jul 13 12:35:02 2013 +0200
+++ b/Player.h	Sat Jul 13 13:12:21 2013 +0200
@@ -571,7 +571,7 @@
   bool CanSteal();
   bool CanEquip_RaceAndAlignmentCheck(unsigned int uItemID);
   int SetCondition(unsigned int uConditionIdx, int a3);
-  int _49327B(unsigned int uClass, int a3);
+  bool GetProfessionOrGuildFlags(unsigned int uClass, int a3);
   void PlaySound(PlayerSpeech speech, int a3);
   void PlayEmotion(CHARACTER_EXPRESSION_ID expression, int a3);
   void ItemsEnchant(int enchant_count);
--- a/mm7_4.cpp	Sat Jul 13 12:35:02 2013 +0200
+++ b/mm7_4.cpp	Sat Jul 13 13:12:21 2013 +0200
@@ -5497,13 +5497,13 @@
         switch ( dword_F8B1AC_award_bit_number )
         {
           case 19:
-            if ( pPlayers[uActiveCharacter]->_49327B(0x22u, 1) == 1 )
+            if ( pPlayers[uActiveCharacter]->GetProfessionOrGuildFlags(0x22u, 1) == 1 )
             {
               if ( !gold_transaction_amount )
                 goto LABEL_79;
               goto LABEL_42;
             }
-            if ( pPlayers[uActiveCharacter]->_49327B(26, 1) == 1 )
+            if ( pPlayers[uActiveCharacter]->GetProfessionOrGuildFlags(0x1Au, 1) == 1 )
             {
               if ( !gold_transaction_amount )
                 goto LABEL_79;
@@ -5511,13 +5511,13 @@
             }
             return v35;
           case 20:
-            if ( pPlayers[uActiveCharacter]->_49327B(0x23u, 1) == 1 )
+            if ( pPlayers[uActiveCharacter]->GetProfessionOrGuildFlags(0x23u, 1) == 1 )
             {
               if ( !gold_transaction_amount )
                 goto LABEL_79;
               goto LABEL_42;
             }
-            if ( pPlayers[uActiveCharacter]->_49327B(27, 1) == 1 )
+            if ( pPlayers[uActiveCharacter]->GetProfessionOrGuildFlags(0x1Bu, 1) == 1 )
             {
               if ( !gold_transaction_amount )
                 goto LABEL_79;