changeset 1355:af2fc30d765f

Player::CanAct, Player::CanSteal shortened a bit
author Grumpy7
date Sat, 13 Jul 2013 13:14:05 +0200
parents 05becb008006
children 301e227439e7
files Player.cpp Player.h mm7_4.cpp
diffstat 3 files changed, 9 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Sat Jul 13 13:12:21 2013 +0200
+++ b/Player.cpp	Sat Jul 13 13:14:05 2013 +0200
@@ -628,7 +628,7 @@
 }
 
 //----- (0049327B) --------------------------------------------------------
-bool Player::GetProfessionOrGuildFlags( unsigned int uClass, int a3 )
+bool Player::ProfessionOrGuildFlagsCorrect( unsigned int uClass, int a3 )
 {
   if ( this->classType == uClass )
   {
@@ -663,24 +663,18 @@
 //----- (00492C0B) --------------------------------------------------------
 bool Player::CanAct()
 {
-  bool result; // eax@2
-
   if ( this->pConditions[Condition_Sleep] || this->pConditions[Condition_Paralyzed] || 
        this->pConditions[Condition_Unconcious] || this->pConditions[Condition_Dead] || 
        this->pConditions[Condition_Pertified] || this->pConditions[Condition_Eradicated] )
-    result = false;
+    return false;
   else
-    result = true;
-  return result;
+    return true;
 }
 
 //----- (00492C40) --------------------------------------------------------
 bool Player::CanSteal()
 {
-  int v1; // eax@1
-
-  LOBYTE(v1) = GetActualSkillLevel(PLAYER_SKILL_STEALING);
-  return v1 != 0;
+  return GetActualSkillLevel(PLAYER_SKILL_STEALING) != 0;
 }
 
 //----- (00492C4E) --------------------------------------------------------
--- a/Player.h	Sat Jul 13 13:12:21 2013 +0200
+++ b/Player.h	Sat Jul 13 13:14:05 2013 +0200
@@ -571,7 +571,7 @@
   bool CanSteal();
   bool CanEquip_RaceAndAlignmentCheck(unsigned int uItemID);
   int SetCondition(unsigned int uConditionIdx, int a3);
-  bool GetProfessionOrGuildFlags(unsigned int uClass, int a3);
+  bool ProfessionOrGuildFlagsCorrect(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 13:12:21 2013 +0200
+++ b/mm7_4.cpp	Sat Jul 13 13:14:05 2013 +0200
@@ -5497,13 +5497,13 @@
         switch ( dword_F8B1AC_award_bit_number )
         {
           case 19:
-            if ( pPlayers[uActiveCharacter]->GetProfessionOrGuildFlags(0x22u, 1) == 1 )
+            if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x22u, 1) == 1 )
             {
               if ( !gold_transaction_amount )
                 goto LABEL_79;
               goto LABEL_42;
             }
-            if ( pPlayers[uActiveCharacter]->GetProfessionOrGuildFlags(0x1Au, 1) == 1 )
+            if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x1Au, 1) == 1 )
             {
               if ( !gold_transaction_amount )
                 goto LABEL_79;
@@ -5511,13 +5511,13 @@
             }
             return v35;
           case 20:
-            if ( pPlayers[uActiveCharacter]->GetProfessionOrGuildFlags(0x23u, 1) == 1 )
+            if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x23u, 1) == 1 )
             {
               if ( !gold_transaction_amount )
                 goto LABEL_79;
               goto LABEL_42;
             }
-            if ( pPlayers[uActiveCharacter]->GetProfessionOrGuildFlags(0x1Bu, 1) == 1 )
+            if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x1Bu, 1) == 1 )
             {
               if ( !gold_transaction_amount )
                 goto LABEL_79;