# HG changeset patch # User Grumpy7 # Date 1396387934 -7200 # Node ID 04efed9483ff7deeb3957116734804d7fc33d723 # Parent 5e4d90305d0621f84259abd404f410fc9eeb1f38 EventCastSpell removing unused vars diff -r 5e4d90305d06 -r 04efed9483ff Spells.cpp --- a/Spells.cpp Tue Apr 01 23:20:15 2014 +0200 +++ b/Spells.cpp Tue Apr 01 23:32:14 2014 +0200 @@ -355,51 +355,29 @@ void __fastcall EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)//sub_448DF8 { int v9; // esi@1 - double v10; // st7@4 - double v11; // st6@4 - double v12; // st5@4 + signed __int64 v10; // st7@4 + signed __int64 v11; // st6@4 + signed __int64 v12; // st5@4 double v13; // st7@6 int v14; // ST44_4@7 uint skillMasteryPlusOne; // ebx@9 - signed int v16; // edx@15 - char *v17; // ecx@16 - unsigned __int16 v18; // ax@20 - char *v19; // ecx@31 - int v20; // edx@35 - signed int v21; // edx@37 - char *v22; // ecx@38 - unsigned __int16 v23; // ax@41 + uint v16; // edx@15 int i; // esi@42 - signed int v25; // edx@55 - char *v26; // ecx@56 - unsigned __int16 v27; // ax@59 + uint v25; // edx@55 int j; // esi@60 - signed int v29; // edx@66 - char *v30; // ecx@67 unsigned __int16 v31; // ax@70 - //Player *v32; // eax@80 - //unsigned __int16 v33; // si@85 - int v34; // eax@96 - int v35; // eax@97 unsigned __int64 v36; // qax@99 SpellBuff *v37; // ecx@99 int v38; // esi@103 signed __int64 v39; // qax@105 - int v40; // ebx@108 - int v41; // ebx@109 int v42; // esi@111 int v43; // ebx@111 - int v44; // eax@117 - //unsigned __int16 v45; // si@137 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99 int v47; // [sp-4h] [bp-B8h]@35 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99 int v49; // [sp+0h] [bp-B4h]@35 int v50; // [sp+0h] [bp-B4h]@99 - int v51; // [sp+4h] [bp-B0h]@35 unsigned __int8 v52; // [sp+4h] [bp-B0h]@99 - float v53; // [sp+14h] [bp-A0h]@4 - float v54; // [sp+18h] [bp-9Ch]@4 int v55; // [sp+28h] [bp-8Ch]@7 unsigned int yaw; // [sp+30h] [bp-84h]@7 int pitch; // [sp+34h] [bp-80h]@7 @@ -408,13 +386,12 @@ //int spellnum_; // [sp+B0h] [bp-4h]@1 //signed int levela; // [sp+BCh] [bp+8h]@80 int a6_4; // [sp+C8h] [bp+14h]@117 - float a7a; // [sp+CCh] [bp+18h]@6 int a7c; // [sp+CCh] [bp+18h]@29 int a7d; // [sp+CCh] [bp+18h]@55 - float a8a; // [sp+D0h] [bp+1Ch]@6 + signed __int64 xSquared; // [sp+D0h] [bp+1Ch]@6 int a8b; // [sp+D0h] [bp+1Ch]@37 int a8c; // [sp+D0h] [bp+1Ch]@55 - float toza; // [sp+D4h] [bp+20h]@6 + signed __int64 ySquared; // [sp+D4h] [bp+20h]@6 v9 = 0; skillMasteryPlusOne = uSkillLevel + 1; @@ -422,32 +399,31 @@ v60 = 0; if ( tox || toy || toz ) { - v10 = (double)tox - (double)fromx; - v11 = (double)toy - (double)fromy; - v12 = (double)toz; + v10 = tox - fromx; + v11 = toy - fromy; + v12 = toz - fromz; } else { - v10 = (double)pParty->vPosition.x - (double)fromx; - v11 = (double)pParty->vPosition.y - (double)fromy; - v12 = (double)(pParty->vPosition.z + pParty->sEyelevel); + v10 = pParty->vPosition.x - fromx; + v11 = pParty->vPosition.y - fromy; + v12 = (pParty->vPosition.z + pParty->sEyelevel) - fromz; } - a7a = v12 - (double)fromz; - toza = v11 * v11; - a8a = v10 * v10; - v13 = sqrt(a7a * a7a + a8a + toza); + v13 = sqrt(v10 * v10 + v11 * v11 + v12 * v12); if ( v13 <= 1.0 ) { - LOBYTE(v55) = 1; + v55 = 1; yaw = 0; pitch = 0; } else { - v55 = (signed __int64)v13; - v14 = (signed __int64)sqrt(a8a + toza); - yaw = stru_5C6E00->Atan2((signed __int64)v10, (signed __int64)v11); - pitch = stru_5C6E00->Atan2(v14, (signed __int64)a7a); + v55 = (int)v13; + ySquared = v11 * v11; + xSquared = v10 * v10; + v14 = (int)sqrt(xSquared + ySquared); + yaw = stru_5C6E00->Atan2((int)v10, (int)v11); + pitch = stru_5C6E00->Atan2(v14, (int)v12); } Assert(skillMasteryPlusOne > 0 && skillMasteryPlusOne <= 4, "Invalid mastery level"); @@ -606,7 +582,7 @@ if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) return; a1.stru_24.Reset(); - v29 = 0; + v31 = 0; a1.spell_id = uSpellID; a1.spell_level = uSkill; a1.spell_skill = skillMasteryPlusOne; @@ -815,7 +791,7 @@ //----- (00427769) -------------------------------------------------------- bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID) { - return ( pSpellDatas[uSpellID].stats & 0xC ); + return ( pSpellDatas[uSpellID].stats & 0xC ) != 0; } //----- (0043AFE3) -------------------------------------------------------- int _43AFE3_calc_spell_damage(int spellId, int spellLevel, signed int skillMastery, int currentHp)