diff Player.cpp @ 1348:3ed6dcf82912

Player::IsPlayerHealableByTemple final version
author Grumpy7
date Sat, 13 Jul 2013 00:25:19 +0200
parents 84db43e7db93
children e721754db8ee
line wrap: on
line diff
--- a/Player.cpp	Fri Jul 12 23:08:35 2013 +0200
+++ b/Player.cpp	Sat Jul 13 00:25:19 2013 +0200
@@ -415,33 +415,31 @@
 
 
 //----- (004B6FF9) --------------------------------------------------------
-int Player::IsPlayerHealableByTemple()
+bool Player::IsPlayerHealableByTemple()
 {
   signed int v2; // eax@1
   v2 = (signed int)window_SpeakInHouse->ptr_1C;
-
-  if ( this->sHealth < GetMaxHealth() || this->sMana < GetMaxMana() )
-  {
-    return 1;
-  }
-  else if (GetMajorConditionIdx() == Condition_Zombie)
-  {
-    if ((v2 == 78 || v2 == 81 || v2 == 82))
-    {
-      return 1;
+  if (this->sHealth >= GetMaxHealth() && this->sMana >= GetMaxMana() && GetMajorConditionIdx() == Condition_Good)
+  {
+    return false;
+  }
+  else
+  {
+    if (GetMajorConditionIdx() == Condition_Zombie)
+    {
+      if ((v2 == 78 || v2 == 81 || v2 == 82))
+      {
+        return false;
+      }
+      else
+      {
+        return true;
+      }
     }
     else
     {
-      return 0;
-    }
-  }
-  else if (GetMajorConditionIdx() == Condition_Good)
-  {
-    return 0;
-  }
-  else
-  {
-    return 1;
+      return true;
+    }
   }
 }