# HG changeset patch # User Grumpy7 # Date 1387499152 -3600 # Node ID 85e9766d6124322f663e2dc6c7bc556e4d7af2ef # Parent e460ca22fe8a91edcfe25af4a7ac2f7713ef75a2 sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick diff -r e460ca22fe8a -r 85e9766d6124 Spells.cpp --- a/Spells.cpp Fri Dec 13 22:19:56 2013 +0600 +++ b/Spells.cpp Fri Dec 20 01:25:52 2013 +0100 @@ -412,17 +412,17 @@ test= tolower(test_string[j]); switch (test) { - case 109: - pSpellDatas[i].field_12|=1; + case 'm': + pSpellDatas[i].stats|=1; break; - case 101: - pSpellDatas[i].field_12|=2; + case 'e': + pSpellDatas[i].stats|=2; break; - case 99: - pSpellDatas[i].field_12|=4; + case 'c': + pSpellDatas[i].stats|=4; break; - case 120: - pSpellDatas[i].field_12|=8; + case 'x': + pSpellDatas[i].stats|=8; break; } } @@ -1164,16 +1164,9 @@ pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); } //----- (00427769) -------------------------------------------------------- -bool __fastcall sub_427769_spell(unsigned int uSpellID) +bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID) { - bool result; // eax@2 - - __debugbreak(); // wut is dat? - if ( pSpellDatas[uSpellID].field_12 & 0xC ) - result = 1; - else - result = 0; - return result; + return ( pSpellDatas[uSpellID].stats & 0xC ); } //----- (0043AFE3) -------------------------------------------------------- int __fastcall _43AFE3_calc_spell_damage(int a1, int a2, signed int a3, int a4) diff -r e460ca22fe8a -r 85e9766d6124 Spells.h --- a/Spells.h Fri Dec 13 22:19:56 2013 +0600 +++ b/Spells.h Fri Dec 20 01:25:52 2013 +0100 @@ -242,7 +242,7 @@ }; }; __int16 field_10; - __int16 field_12; + __int16 stats; // char field_12; // char field_13; // __int16 field_14; diff -r e460ca22fe8a -r 85e9766d6124 Viewport.cpp --- a/Viewport.cpp Fri Dec 13 22:19:56 2013 +0600 +++ b/Viewport.cpp Fri Dec 20 01:25:52 2013 +0100 @@ -487,7 +487,7 @@ pParty->uFlags |= PARTY_FLAGS_1_FALLING; return; } - if ( uActiveCharacter && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell)) + if ( uActiveCharacter && sub_427769_isSpellQuickCastableOnShiftClick(pPlayers[uActiveCharacter]->uQuickSpell)) pMessageQueue_50CBD0->AddMessage(UIMSG_CastQuickSpell, 0, 0); } return; diff -r e460ca22fe8a -r 85e9766d6124 mm7_data.h --- a/mm7_data.h Fri Dec 13 22:19:56 2013 +0600 +++ b/mm7_data.h Fri Dec 20 01:25:52 2013 +0100 @@ -1108,7 +1108,7 @@ bool PortalFrustrum(int pNumVertices, struct BspRenderer_PortalViewportData *a2, struct BspRenderer_PortalViewportData *near_portal, int uFaceID); int ODM_NearClip(unsigned int uVertexID); // idb int ODM_FarClip(unsigned int uNumVertices); -bool __fastcall sub_427769_spell(unsigned int uSpellID); +bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID); void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6); void _42ECB5_PlayerAttacksActor(); void InitializeTurnBasedAnimations(void *);