changeset 1278:ce8ea73e7678

changed Player::_4B6FF9 to Player::IsPlayerHealableByTemple
author Grumpy7
date Sat, 15 Jun 2013 07:52:05 +0200
parents 1803172dffd9
children 34c433886ed4
files Player.cpp Player.h UIHouses.cpp
diffstat 3 files changed, 19 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Sat Jun 15 07:50:08 2013 +0200
+++ b/Player.cpp	Sat Jun 15 07:52:05 2013 +0200
@@ -412,30 +412,27 @@
 
 
 //----- (004B6FF9) --------------------------------------------------------
-int Player::_4B6FF9()
-{
-  Player *v1; // esi@1
+int Player::IsPlayerHealableByTemple()
+{
   signed int v2; // eax@1
-  char v3; // zf@4
-
-  v1 = this;
   v2 = (signed int)window_SpeakInHouse->ptr_1C;
-  if ( (v2 == 78 || v2 > 80) && v2 <= 82 )
-  {
-    if ( GetMajorConditionIdx() == 18 )
-      goto LABEL_6;
-    v3 = GetMajorConditionIdx() == 17;
+
+  if ( this->sHealth < GetMaxHealth() || this->sMana < GetMaxMana() )
+  {
+    return 1;
+  }
+  else if (GetMajorConditionIdx() == 18)
+  {
+    return 0;
+  }
+  else if (GetMajorConditionIdx() == 17 && (v2 == 78 || v2 > 80) && v2 <= 82)
+  {
+    return 0;
   }
   else
   {
-    v3 = GetMajorConditionIdx() == 18;
-  }
-  if ( !v3 )
     return 1;
-LABEL_6:
-  if ( v1->sHealth < GetMaxHealth() || v1->sMana < GetMaxMana() )
-    return 1;
-  return 0;
+  }
 }
 
 
--- a/Player.h	Sat Jun 15 07:50:08 2013 +0200
+++ b/Player.h	Sat Jun 15 07:52:05 2013 +0200
@@ -575,7 +575,7 @@
   void PlayEmotion(CHARACTER_EXPRESSION_ID expression, int a3);
   void ItemsEnchant(int enchant_count);
   unsigned int GetItemIDAtInventoryIndex(int *a2);
-  int _4B6FF9();
+  int IsPlayerHealableByTemple();
   int GetBaseIdentifyPrice(float a2);
   int GetBaseRepairPrice(int a2, float a3);
   int GetBaseBuyingPrice(int a2, float a3);
--- a/UIHouses.cpp	Sat Jun 15 07:50:08 2013 +0200
+++ b/UIHouses.cpp	Sat Jun 15 07:52:05 2013 +0200
@@ -710,7 +710,7 @@
 		  }
 		  else if (uActiveCharacter)
 		  {
-			if ( !pPlayers[uActiveCharacter]->_4B6FF9() )
+			if ( !pPlayers[uActiveCharacter]->IsPlayerHealableByTemple() )
 			  return;
 			v8 = window_SpeakInHouse;
 		  }
@@ -4920,7 +4920,7 @@
           pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25);
           return;
         }
-        if ( !v1->_4B6FF9() )
+        if ( !v1->IsPlayerHealableByTemple() )
             return;
         v25 = 0;
         if ( pParty->uNumGold < v2 )
@@ -4993,7 +4993,7 @@
     strcpy(a1, "");
     v41->uHeight = 0;
     v41->uY = 0;
-    if ( v1->_4B6FF9() )
+    if ( v1->IsPlayerHealableByTemple() )
         {
         sprintf(a1, "%s %d %s", pGlobalTXT_LocalizationStrings[104], HIDWORD(v60), pGlobalTXT_LocalizationStrings[97]);
         v63 = 0;