changeset 321:15decc249a94

quick fix to spells commit (wasnt compiling)
author Nomad
date Wed, 20 Feb 2013 03:35:22 +0200
parents 0b2af9c5f70f
children ce39b96acf5c
files Actor.cpp Party.cpp mm7_4.cpp mm7_5.cpp mm7_data.cpp mm7_data.h
diffstat 6 files changed, 22 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Wed Feb 20 02:56:46 2013 +0200
+++ b/Actor.cpp	Wed Feb 20 03:35:22 2013 +0200
@@ -3238,6 +3238,7 @@
 
     case MONSTER_DRAGON_1: case MONSTER_DRAGON_2: case MONSTER_DRAGON_3:
       drop.uItemID = ITEM_DRAGON_EYE;
+    break;
   }
 
   if (rand() % 100 < 20)
--- a/Party.cpp	Wed Feb 20 02:56:46 2013 +0200
+++ b/Party.cpp	Wed Feb 20 03:35:22 2013 +0200
@@ -280,7 +280,7 @@
   signed __int16 v3; // ax@1
   //int pResMagicBase; // ecx@1
   Player *pCharacter; // esi@3
-  signed int uSpellBookPageCount; // edx@5
+  //signed int uSpellBookPageCount; // edx@5
   int pMagicSkills; // eax@5
   int uSkillIdx; // eax@11
   //unsigned __int8 v9; // zf@37
@@ -377,9 +377,10 @@
     pCharacter = &pParty->pPlayers[uNumPlayers];
     if (pCharacter->classType == PLAYER_CLASS_KNIGHT)
       pCharacter->sResMagicBase = v3; //player[i].pResMagicBase
-    uSpellBookPageCount = 0;
+    //uSpellBookPageCount = 0;
     //pMagicSkills = pPlayers[uNumPlayers].pActiveSkills[12];// Skills
     //while ( !*(short *)pMagicSkills )         //player[i].skillFire
+    pCharacter->lastOpenedSpellbookPage = 0;
 	for (int i = 0; i < 9; i++)//for Magic Book
     {
       //++uSpellBookPageCount;
@@ -387,9 +388,11 @@
       //if ( uSpellBookPageCount >= 9 )
         //goto LABEL_10;
 	    if (pPlayers[uNumPlayers].pActiveSkills[12+i])
-			++uSpellBookPageCount;
+        {
+          pCharacter->lastOpenedSpellbookPage = i;
+          break;
+        }
     }
-    pCharacter->lastOpenedSpellbookPage = uSpellBookPageCount;
 //LABEL_10:
     pCharacter->uExpressionTimePassed = 0;
     Dst.Reset();
--- a/mm7_4.cpp	Wed Feb 20 02:56:46 2013 +0200
+++ b/mm7_4.cpp	Wed Feb 20 03:35:22 2013 +0200
@@ -5872,7 +5872,7 @@
   int v9; // edx@31
   char *v10; // ebx@37
   Player *v11; // esi@38
-  signed int uSpellBookPageCount; // ecx@40
+  //signed int uSpellBookPageCount; // ecx@40
   int v13; // eax@40
   //signed int uSkillIdx; // eax@45
   int v15; // eax@70
@@ -6010,13 +6010,14 @@
       player->sResMagicBase = 10;
     //*((short *)v10 + 400) = 0;
     player->pPlayerBuffs[22].uExpireTime = 0;
-    uSpellBookPageCount = 0;
     for (uint j = 0; j < 9; j++)
     {
       if (player->pActiveSkills[PLAYER_SKILL_FIRE + j])
-        ++uSpellBookPageCount;
-    }
-    player->lastOpenedSpellbookPage = uSpellBookPageCount;
+      {
+        player->lastOpenedSpellbookPage = j;
+        break;
+      }
+    }
     pItemsTable->GenerateItem(2, 40, &item);
     player->AddItem2(-1, &item);
     //uSkillIdx = 0;
--- a/mm7_5.cpp	Wed Feb 20 02:56:46 2013 +0200
+++ b/mm7_5.cpp	Wed Feb 20 03:35:22 2013 +0200
@@ -13538,16 +13538,17 @@
   else
     dword_50654C = 0;
 
-  char *v11 = &pPlayer->field_152[11 * school + 63];
+  //char *v11 = &pPlayer->field_152[11 * school + 63];
 
   for (uint i = 1; i < 12; ++i)
   {
-    if (v11[i])
-    {
-      sprintf(pContainer, "SB%cS%02d", spellbook_texture_filename_suffices[school], pSpellbookSpellIndices[school][i]);
+    //if (v11[i])
+    if (pPlayer->spellbook.pChapters[school].bIsSpellAvailable[i - 1])
+    {
+      sprintf(pContainer, "SB%sS%02d", spellbook_texture_filename_suffices[school], pSpellbookSpellIndices[school][i]);
       dword_506408[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
 
-      sprintf(pContainer, "SB%cC%02d", spellbook_texture_filename_suffices[school], pSpellbookSpellIndices[school][i]);
+      sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[school], pSpellbookSpellIndices[school][i]);
       dword_5063D8[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
     }
   }
--- a/mm7_data.cpp	Wed Feb 20 02:56:46 2013 +0200
+++ b/mm7_data.cpp	Wed Feb 20 03:35:22 2013 +0200
@@ -376,7 +376,7 @@
 char aPending[777]; // idb
 char aCanTFindS[777]; // idb
 char pDayMoonPhase[28];
-char *spellbook_texture_filename_suffices[8]; // weak
+char *spellbook_texture_filename_suffices[8] = {"f", "a", "w", "e", "s", "m", "b", "l"}; // weak
 __int16 word_4E1D3A[777]; // weak
 __int16 pTownPortalBook_xs[6];
 __int16 pTownPortalBook_ys[6];
--- a/mm7_data.h	Wed Feb 20 02:56:46 2013 +0200
+++ b/mm7_data.h	Wed Feb 20 03:35:22 2013 +0200
@@ -366,7 +366,7 @@
 extern char aPending[]; // idb
 extern char aCanTFindS[]; // idb
 extern char pDayMoonPhase[28];
-extern char spellbook_texture_filename_suffices[9]; // weak
+extern char *spellbook_texture_filename_suffices[]; // weak
 extern __int16 word_4E1D3A[]; // weak
 extern __int16 pTownPortalBook_xs[6];
 extern __int16 pTownPortalBook_ys[6];