diff mm7_5.cpp @ 23:509744251c8e

Player-related members
author Nomad
date Sun, 14 Oct 2012 00:27:38 +0200
parents 3fa5d0522f92
children 93bf1d5f6a6d
line wrap: on
line diff
--- a/mm7_5.cpp	Sat Oct 13 20:18:28 2012 +0200
+++ b/mm7_5.cpp	Sun Oct 14 00:27:38 2012 +0200
@@ -1313,7 +1313,7 @@
                       }
                       if ( ptr_50C9A4 && ptr_50C9A4->uItemID )
                       {
-                        LOBYTE(ptr_50C9A4->uAttributtes) &= 0xFu;
+                        LOBYTE(ptr_50C9A4->uAttributes) &= 0xFu;
                         dword_50C9A8 = 0;
                         ptr_50C9A4 = 0;
                       }
@@ -3173,7 +3173,7 @@
           v106 = pPlayers[uMessageParam];
           sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v106->pName, pClassNames[v106->uClass]);// "%s the %s"
           strcat(pTmpBuf, ": ");
-          v107 = v106->GetMajorConditionrIdx();
+          v107 = v106->GetMajorConditionIdx();
           strcat(pTmpBuf, aCharacterConditionNames[v107]);
           sub_41C0B8_set_status_string(pTmpBuf);
           v108 = 8 * uMessageParam - 8;
@@ -3460,9 +3460,8 @@
         {
           if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
             continue;
-LABEL_99:
-          v40 = 9;
-          goto LABEL_89;
+
+          SetCurrentMenuID(MENU_LOAD);
         }
         continue;
       }
@@ -3600,7 +3599,8 @@
               (enum WindowType)90,
               (int)pMainMenu_BtnNew,
               0);
-            goto LABEL_99;
+          SetCurrentMenuID(MENU_LOAD);
+          continue;
           }
           if ( v45 != 174 )
             continue;
@@ -3617,7 +3617,7 @@
 LABEL_89:
           v2 = v40;
 LABEL_90:
-          SetCurrentMenuID(v2);
+          SetCurrentMenuID((MENU_STATE)v2);
           continue;
         }
         if ( v45 == UIMSG_A3 )
@@ -3667,12 +3667,12 @@
 LABEL_83:
             if ( v17 == 16 )
               pVideoPlayer->FastForwardToFrame(pVideoPlayer->field_40);
-            if ( GetCurrentMenuID() == 7 )
+            if (GetCurrentMenuID() == MENU_7)
             {
               v40 = 6;
               goto LABEL_89;
             }
-            if ( GetCurrentMenuID() == 8 )
+            if (GetCurrentMenuID() == MENU_Credits)
             {
               v40 = 11;
               goto LABEL_89;
@@ -3699,7 +3699,7 @@
             crt_deconstruct_ptr_6A0118();
             stru_506F20.Release();
             stru_506F20.Load("title.pcx", 0);
-            SetCurrentMenuID(0);
+            SetCurrentMenuID(MENU_MAIN);
             v15 = 1;
 LABEL_81:
             pGUIWindow_CurrentMenu->Release();
@@ -4965,7 +4965,7 @@
     v59 = 1;
     if ( pPlayer->HasItemEquipped(EQUIP_TWO_HANDED) )
     {
-      v55 = pItemsTable->pItems[*(int *)&pPlayer->pDarkSpellbook.bIsSpellAvailable[36 * (int)v51 + 5]].uSkillType;
+      v55 = pItemsTable->pItems[*(int *)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)v51 + 5]].uSkillType;
       v28 = SkillToMastery(pPlayer->pActiveSkills[v55]);
       uDamageAmount = v28;
       if ( v55 )
@@ -5171,7 +5171,7 @@
       {
         if ( pPlayer->HasItemEquipped((ITEM_EQUIP_TYPE)v59) )
         {
-          auto _s = (ItemGen *)&pPlayer->pDarkSpellbook.bIsSpellAvailable[36 * v57->uOffHand + 5];
+          auto _s = (ItemGen *)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v57->uOffHand + 5];
           a4 = _s->_439DF3_get_additional_damage(&a2, &v62);
           if ( v62 && pMonster->sCurrentHP > 0 )
           {
@@ -7031,7 +7031,7 @@
     if ( !v21 )
       goto LABEL_59;
     v230 = pPlayer->pEquipment.uBow;
-    v22 = (int)&v217->pDarkSpellbook.bIsSpellAvailable[36 * v21 + 5];
+    v22 = (int)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v21 + 5];
     v23 = *(int *)v22;
     v24 = papredoll_4E4C28 + array_4E4C30[v239].equip_x - pItemsTable->pItems[v23].uEquipX;
     a3b = paperdoll_4E4C2C + array_4E4C30[v239].equip_y - pItemsTable->pItems[v23].uEquipY;
@@ -7067,7 +7067,7 @@
       if ( !v31 )
         goto LABEL_93;
       v231 = v217->pEquipment.uCloak;
-      v32 = (int)&v217->pDarkSpellbook.bIsSpellAvailable[36 * v31 + 5];
+      v32 = (int)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v31 + 5];
       v219 = v32;
       if ( *(int *)v32 != 525 )
       {
@@ -7121,7 +7121,7 @@
                 if ( !v43 )
                   goto LABEL_127;
                 v232 = v217->pEquipment.uBody;
-                v44 = (int)&v217->pDarkSpellbook.bIsSpellAvailable[36 * v43 + 5];
+                v44 = (int)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v43 + 5];
                 v220 = v44;
                 if ( *(int *)v44 != 504 )
                 {
@@ -7180,7 +7180,7 @@
                           if ( !v56 )
                             goto LABEL_155;
                           v233 = v217->pEquipment.field_20;
-                          v57 = (int)&v217->pDarkSpellbook.bIsSpellAvailable[36 * v56 + 5];
+                          v57 = (int)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v56 + 5];
                           v221 = v57;
                           v58 = *(int *)v57;
                           if ( *(int *)v57 == 529 )
@@ -7245,7 +7245,7 @@
                             v69 = v217->pEquipment.uMainHand;
                             uPlayerID_a = 2 * v239;
                             if ( !v69
-                              || (v70 = *(int *)&v217->pDarkSpellbook.bIsSpellAvailable[36 * v69 + 5],
+                              || (v70 = *(int *)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v69 + 5],
                                   pItemsTable->pItems[v70].uEquipType != 1)
                               && (pItemsTable->pItems[v70].uSkillType != 4 || v217->pEquipment.uOffHand) )
                               pRenderer->DrawTextureTransparent(
@@ -7256,7 +7256,7 @@
                             if ( v71 )
                             {
                               v234 = v217->pEquipment.uBelt;
-                              v72 = (int)&v217->pDarkSpellbook.bIsSpellAvailable[36 * v71 + 5];
+                              v72 = (int)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v71 + 5];
                               v222 = v72;
                               if ( *(int *)v72 == 524 )
                               {
@@ -7354,7 +7354,7 @@
                             v82 = v68->pEquipment.uMainHand;
                             if ( v82 )
                             {
-                              v83 = *(int *)&v68->pDarkSpellbook.bIsSpellAvailable[36 * v82 + 5];
+                              v83 = *(int *)&v68->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v82 + 5];
                               if ( pItemsTable->pItems[v83].uEquipType == 1
                                 || pItemsTable->pItems[v83].uSkillType == 4 && !v68->pEquipment.uOffHand )
                                 pRenderer->DrawTextureTransparent(
@@ -7387,7 +7387,7 @@
                                       if ( !v111 )
                                         goto LABEL_293;
                                       v236 = v68->pEquipment.uCloak;
-                                      v112 = (int)&v68->pDarkSpellbook.bIsSpellAvailable[36 * v111 + 5];
+                                      v112 = (int)&v68->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v111 + 5];
                                       v225 = v112;
                                       v113 = *(int *)v112;
                                       if ( v113 != 525 )
@@ -7435,7 +7435,7 @@
                                                 if ( !v123 )
                                                   goto LABEL_335;
                                                 v237 = v123;
-                                                v124 = (int)&v217->pDarkSpellbook.bIsSpellAvailable[36 * v123 + 5];
+                                                v124 = (int)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v123 + 5];
                                                 v226 = v124;
                                                 if ( *(int *)v124 != 521 )
                                                 {
@@ -7540,7 +7540,7 @@
                                                   if ( !v134 )
                                                     goto LABEL_358;
                                                   v238 = v217->pEquipment.uMainHand;
-                                                  v135 = (int)&v217->pDarkSpellbook.bIsSpellAvailable[36 * v134 + 5];
+                                                  v135 = (int)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v134 + 5];
                                                   v227 = v135;
                                                   v136 = *(int *)v135;
                                                   v137 = *(int *)v135;
@@ -7585,7 +7585,7 @@
                                                     v249 = v217->pEquipment.uOffHand;
                                                     if ( !v145 )
                                                       goto LABEL_393;
-                                                    v146 = (int)&v217->pDarkSpellbook.bIsSpellAvailable[36 * v145 + 5];
+                                                    v146 = (int)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v145 + 5];
                                                     v228 = v146;
                                                     v147 = *(int *)v146;
                                                     v148 = *(int *)v146;
@@ -8236,7 +8236,7 @@
   uPlayerID_a = 2 * v5;
   v6 = pPlayer->pEquipment.uMainHand;
   if ( !v6
-    || (v7 = *(int *)&pPlayer->pDarkSpellbook.bIsSpellAvailable[36 * v6 + 5], pItemsTable->pItems[v7].uEquipType != 1)
+    || (v7 = *(int *)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v6 + 5], pItemsTable->pItems[v7].uEquipType != 1)
     && (pItemsTable->pItems[v7].uSkillType != 4 || pPlayer->pEquipment.uOffHand) )
     pRenderer->DrawTextureTransparent(
       papredoll_4E4C28 + dword_4E5AE0[2 * v5],
@@ -8250,7 +8250,7 @@
   if ( v8 )
   {
     v229 = pPlayer->pEquipment.uMainHand;
-    v9 = (int)&v217->pDarkSpellbook.bIsSpellAvailable[36 * v8 + 5];
+    v9 = (int)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v8 + 5];
     v10 = v5 << 7;
     v218 = v9;
     v11 = *(int *)v9;
@@ -8341,7 +8341,7 @@
   v161 = v217->pEquipment.uMainHand;
   if ( v161 )
   {
-    v162 = *(int *)&v217->pDarkSpellbook.bIsSpellAvailable[36 * v161 + 5];
+    v162 = *(int *)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v161 + 5];
     if ( pItemsTable->pItems[v162].uEquipType == 1
       || pItemsTable->pItems[v162].uSkillType == 4 && !v217->pEquipment.uOffHand )
       pRenderer->DrawTextureTransparent(
@@ -8443,7 +8443,7 @@
     if ( !*(int *)v46 )
       goto LABEL_24;
     v39 = *(int *)v46;
-    v4 = (int)&pPlayer->pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v46 + 5];
+    v4 = (int)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v46 + 5];
     a3 = *(int *)((char *)dword_4E5C34 + v3);
     a2 = *(int *)((char *)dword_4E5C1C + v3);
     v5 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v4].pIconName, TEXTURE_16BIT_PALETTE);
@@ -8533,7 +8533,7 @@
   if ( !v15 )
     goto LABEL_46;
   v41 = pPlayer->pEquipment.field_24;
-  v49 = (int)&pPlayer->pDarkSpellbook.bIsSpellAvailable[36 * v15 + 5];
+  v49 = (int)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v15 + 5];
   v16 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v49].pIconName, TEXTURE_16BIT_PALETTE);
   v17 = *(int *)(v49 + 20);
   if ( !(*(int *)(v49 + 20) & 0xF0) )
@@ -8615,7 +8615,7 @@
   if ( !v26 )
     return;
   v43 = pPlayer->pEquipment.field_1C;
-  v27 = (int)&pPlayer->pDarkSpellbook.bIsSpellAvailable[36 * v26 + 5];
+  v27 = (int)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v26 + 5];
   v28 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v27].pIconName, TEXTURE_16BIT_PALETTE);
   v29 = *(int *)(v27 + 20);
   if ( !(*(int *)(v27 + 20) & 0xF0) )
@@ -8788,7 +8788,7 @@
       if ( *v5 )
       {
         result = 9 * *v5;
-        if ( *(int *)&pPlayer->pDarkSpellbook.bIsSpellAvailable[36 * *v5 + 5] == uItemID )
+        if ( *(int *)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *v5 + 5] == uItemID )
           break;
       }
       ++v4;
@@ -8803,7 +8803,7 @@
           if ( *v7 )
           {
             result *= 9;
-            if ( *(int *)&pPlayer->pDarkSpellbook.bIsSpellAvailable[4 * result + 5] == uItemID )
+            if ( *(int *)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5] == uItemID )
               break;
           }
           ++v6;
@@ -8847,7 +8847,7 @@
         if ( !result )
           break;
         result *= 9;
-        if ( *(int *)&v6->pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v5 )
+        if ( *(int *)&v6->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v5 )
           break;
         ++pPlayers;
         if ( (signed int)pPlayers >= (signed int)&qword_A750D8 )
@@ -8859,7 +8859,7 @@
   result = sub_43EE15_player_has_item(604u, ::pPlayers[a1], 0);
   if ( !result
     || (result = v2->pEquipment.uBody) == 0
-    || (result *= 9, *(int *)&v2->pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v3) )
+    || (result *= 9, *(int *)&v2->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v3) )
   {
 LABEL_6:
     LOBYTE(result) = 0;
@@ -15079,7 +15079,7 @@
             {
               if ( v26 < 800 )
               {
-                _this.uAttributtes |= 1u;
+                _this.uAttributes |= 1u;
                 _this.uItemID = v26;
                 if ( pItemsTable->pItems[v26].uEquipType == 12 )
                 {
@@ -15528,11 +15528,11 @@
       {
         if ( pParty->pPickedItem.uItemID == 236 )
         {
-          v35 = v27->uAttributtes;
+          v35 = v27->uAttributes;
           if ( v35 & 2 || (v51 & 0x80000000u) != 0 || (signed int)v51 > 12 || (signed int)v28 >= 500 )
             goto LABEL_92;
           LOWORD(v35) = v35 | 0x210;
-          v27->uAttributtes = v35;
+          v27->uAttributes = v35;
         }
         else
         {
@@ -15543,7 +15543,7 @@
             v27->UpdateTempBonus(pParty->uTimePlayed);
             v33 = v27->uItemID;
             if ( (signed int)v27->uItemID >= 64 && (signed int)v33 <= 65
-              || (pOut.y = v27->uAttributtes, pOut.y & 2)
+              || (pOut.y = v27->uAttributes, pOut.y & 2)
               || v27->uAdditionalValue
               || v27->_bonus_type
               || v51 && v51 != 1 && v51 != 2
@@ -15559,7 +15559,7 @@
             if ( pParty->pPickedItem.uItemID != 263
               || (v27->UpdateTempBonus(pParty->uTimePlayed), v30 = v27->uItemID, (signed int)v27->uItemID >= 64)
               && (signed int)v30 <= 65
-              || (pOut.y = v27->uAttributtes, pOut.y & 2)
+              || (pOut.y = v27->uAttributes, pOut.y & 2)
               || v27->uAdditionalValue
               || v27->_bonus_type
               || v51 && v51 != 1 && v51 != 2
@@ -15574,7 +15574,7 @@
           LODWORD(v32) = pOut.y;
           LOBYTE(v32) = LOBYTE(pOut.y) | 0x18;
           HIDWORD(v27->uExpireTime) = HIDWORD(v32);
-          v27->uAttributtes = v32;
+          v27->uAttributes = v32;
         }
         dword_50C9A8 = 256;
         goto LABEL_92;
@@ -16990,7 +16990,9 @@
       v7 = pTmpBuf2;
       v20 = pTmpBuf2;
       strcat(pTmpBuf2, "\n");
-      v23 = pConditionImportancyTable;
+
+      extern unsigned int pConditionImportancyTable[18];
+      v23 = (int *)pConditionImportancyTable;
       _y = pPlayers[uActiveCharacter];
       v21 = pPlayers[uActiveCharacter];
       do
@@ -17131,7 +17133,6 @@
   }
   return (char)_y;
 }
-// 4E2A12: using guessed type void *off_4E2A12;
 
 //----- (00418511) --------------------------------------------------------
 char __fastcall CharacterUI_StatsTab_Draw(unsigned int uPlayerID)
@@ -17372,7 +17373,7 @@
   sprintfex(pTmpBuf, "%s", pGlobalTXT_LocalizationStrings[12], v60, v57, v56);
   pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v55, 0, pTmpBuf, 0, 0, 0);
   v61 = v55 + 2 * LOBYTE(pFontArrus->uFontHeight) - 2;
-  v62 = pPlayer->GetMajorConditionrIdx();
+  v62 = pPlayer->GetMajorConditionIdx();
   v63 = aCharacterConditionNames[v62];
   v64 = GetConditionDrawColor(v62);
   sprintfex(pTmpBuf, "%s: ", pGlobalTXT_LocalizationStrings[47], v64, v63);