diff Player.cpp @ 488:a3939d5067c4

Spells
author Nomad
date Wed, 27 Feb 2013 22:15:30 +0200
parents 7887a9cf9e7b
children 59649750a054
line wrap: on
line diff
--- a/Player.cpp	Wed Feb 27 17:29:05 2013 +0200
+++ b/Player.cpp	Wed Feb 27 22:15:30 2013 +0200
@@ -189,21 +189,14 @@
 //----- (00427730) --------------------------------------------------------
 bool Player::CanCastSpell(unsigned int uRequiredMana)
 {
-  int v2; // eax@1
-  bool result; // eax@2
-
-  v2 = this->sMana;
-  if ( v2 >= (signed int)uRequiredMana )
-  {
-    this->sMana = v2 - uRequiredMana;
-    result = 1;
-  }
-  else
-  {
-    pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-    result = 0;
-  }
-  return result;
+  if (sMana >= uRequiredMana)
+  {
+    sMana -= uRequiredMana;
+    return true;
+  }
+
+  pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
+  return false;
 }
 
 
@@ -4150,7 +4143,7 @@
     v9 = *(int *)v8;
     v3 = (char *)&pItemsTable->pItems[v9].pIconName;
     if ( v3[28] == 12 )
-      v10 = *(&pSpellDatas[0].field_A + 10 * *((int *)&pSpellDatas[66].field_8 + v9));
+      v10 = *(&pSpellDatas[0].uExpertLevelRecovery + 10 * *((int *)&pSpellDatas[66].uNormalLevelRecovery + v9));
     else
       v10 = (unsigned __int16)word_4EDED8[(unsigned __int8)v3[29]];
     v47 = v10;