diff mm7_4.cpp @ 1483:223605b325b3

Слияние
author Ritor1
date Thu, 29 Aug 2013 12:04:55 +0600
parents 7ef4b64f6329
children a27cdb3d753e
line wrap: on
line diff
--- a/mm7_4.cpp	Thu Aug 29 12:04:33 2013 +0600
+++ b/mm7_4.cpp	Thu Aug 29 12:04:55 2013 +0600
@@ -47,7 +47,7 @@
 #include "Lights.h"
 
 //----- (0046CC4B) --------------------------------------------------------
-void __cdecl check_event_triggers()
+void check_event_triggers()
 {
   int v0; // eax@1
   LevelDecoration *v1; // esi@2
@@ -90,9 +90,9 @@
   signed int v38; // [sp+20h] [bp-4h]@24
 
   v0 = 0;
-  for ( i = 0; i < _6836C8_num_decorations_6807E8; ++i )
+  for ( i = 0; i < num_event_triggers; ++i )
   {
-    v1 = &pLevelDecorations[_6807E8_level_decorations_ids[v0]];
+    v1 = &pLevelDecorations[event_triggers[v0]];
     v2 = v1->field_18;
     v3 = v1->vPosition.y;
     v33 = v1->vPosition.x;
@@ -440,7 +440,7 @@
 }
 
 //----- (0046E0B2) --------------------------------------------------------
-void __cdecl _46E0B2_collide_against_decorations()
+void  _46E0B2_collide_against_decorations()
 {
   BLVSector *v0; // ebp@1
   LevelDecoration *v1; // edi@2
@@ -532,7 +532,7 @@
 }
 
 //----- (00487DA9) --------------------------------------------------------
-void __cdecl sub_487DA9()
+void  sub_487DA9()
 {
   for (int i = 0; i < 20000; ++i)
     array_77EC08[i].field_108 = 0;
@@ -597,7 +597,7 @@
 }
 
 //----- (00491E3A) --------------------------------------------------------
-void __cdecl sub_491E3A()
+void sub_491E3A()
 {
   Player *v0; // ebx@1
   signed int v1; // esi@3
@@ -698,7 +698,7 @@
 // 4ED498: using guessed type char byte_4ED498;
 
 //----- (00493938) --------------------------------------------------------
-int __cdecl _493938_regenerate()
+int  _493938_regenerate()
 {
   int v0; // edi@1
   signed __int64 v1; // qax@1
@@ -842,7 +842,7 @@
       a1.spell_caster_pid = v12;
       a1.uFacing = 0;
       a1.uSoundID = 0;
-      v13 = sub_46A89E((int)v41, 100, 307);
+      v13 = _46A89E_immolation_effect((int)v41, 100, 307);
       if ( v13 > 0 )
       {
         do
@@ -1070,7 +1070,7 @@
 }
 
 //----- (00493F79) --------------------------------------------------------
-void sub_493F79(stru351_summoned_item *_this, __int64 a2)
+void init_summoned_item(stru351_summoned_item *_this, __int64 duration)
 {
   signed __int64 v2; // ST2C_8@1
   signed __int64 v3; // qax@1
@@ -1078,7 +1078,7 @@
   unsigned __int64 v5; // qax@1
   unsigned int v6; // ebx@1
 
-  v2 = (signed __int64)((double)a2 * 0.234375);
+  v2 = (signed __int64)((double)duration * 0.234375);
   v3 = v2 / 60 / 60;
   //v4 = v3;
   v5 = (unsigned int)v3 / 0x18;
@@ -1697,11 +1697,19 @@
 }
 
 //----- (00494C0F) --------------------------------------------------------
-void PlayerFrameTable::FromFile(void *pSerialized)
+void PlayerFrameTable::FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
 {
-  uNumFrames = *(int *)pSerialized;
-  pFrames = (PlayerFrame *)pAllocator->AllocNamedChunk(pFrames, 10 * uNumFrames, "P Frames");
-  memcpy(pFrames, (char *)pSerialized + 4, 10 * uNumFrames);
+  uint num_mm6_frames = data_mm6 ? *(int *)data_mm6 : 0,
+       num_mm7_frames = data_mm7 ? *(int *)data_mm7 : 0,
+       num_mm8_frames = data_mm8 ? *(int *)data_mm8 : 0;
+  uNumFrames = num_mm6_frames + num_mm7_frames + num_mm8_frames;
+  assert(uNumFrames);
+  assert(!num_mm8_frames);
+
+  pFrames = (PlayerFrame *)pAllocator->AllocNamedChunk(pFrames, uNumFrames * sizeof(PlayerFrame), "P Frames");
+  memcpy(pFrames,                                   (char *)data_mm7 + 4, num_mm7_frames * sizeof(PlayerFrame));
+  memcpy(pFrames + num_mm7_frames,                  (char *)data_mm6 + 4, num_mm6_frames * sizeof(PlayerFrame));
+  memcpy(pFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 4, num_mm8_frames * sizeof(PlayerFrame));
 }
 
 //----- (00494C5A) --------------------------------------------------------
@@ -1885,8 +1893,7 @@
   dword_AE3370 = v3;
   return pNPCStats->pNPCNames[0][v11 + 2 * v3];
 }
-// AE336C: using guessed type int dword_AE336C;
-// AE3370: using guessed type int dword_AE3370;
+
 
 //----- (00495430) --------------------------------------------------------
 char * GetReputationString( signed int a1 )
@@ -2000,8 +2007,8 @@
           break;
         case 8:
           v63 = 0;
-          v20 = (unsigned __int8 *)pPlayer->_guilds_member_bits;
-          for ( uint i = 0; i < 28; ++i )
+          v20 = (unsigned __int8 *)pPlayer->_achieved_awards_bits;
+          for ( uint _i = 0; _i < 28; ++_i )
           {
             if ( (unsigned __int16)_449B57_test_bit(v20, word_4EE150[i]) )
             {
@@ -2142,8 +2149,8 @@
           i += 2;
           break;
         case 23:
-          if ( pMapStats->GetMapInfo(pCurrentMapName.data()) )
-            pText = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName.data())].pName;
+          if ( pMapStats->GetMapInfo(pCurrentMapName) )
+            pText = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName;
           else
             pText = pGlobalTXT_LocalizationStrings[394];// "Unknown"
           strcat(pTmpBuf2.data(), pText);
@@ -2241,7 +2248,7 @@
               i += 2;
               break;
             }
-            sub_493F79(&v56, *a6);
+            init_summoned_item(&v56, *a6);
             sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year);
             strcat(pTmpBuf2.data(), a1);
             dst = strlen(pTmpBuf2.data());
@@ -2272,7 +2279,7 @@
               i += 2;
               break;
             }
-            sub_493F79(&v56, pParty->field_3C._s_times[v17-51]);
+            init_summoned_item(&v56, pParty->field_3C._s_times[v17-51]);
             sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year);
             strcat(pTmpBuf2.data(), a1);
             dst = strlen(pTmpBuf2.data());
@@ -2615,7 +2622,7 @@
 }
 
 //----- (004A57E9) --------------------------------------------------------
-void __cdecl Present_ColorKey()
+void  Present_ColorKey()
 {
   HRESULT v0; // eax@3
   HRESULT v1; // eax@3
@@ -2927,7 +2934,7 @@
     if ( pParty->uFine )
     {
       //v10 = result->_guilds_member_bits;
-      result = (Player *)_449B57_test_bit((unsigned __int8 *)result->_guilds_member_bits, 1);
+      result = (Player *)_449B57_test_bit((unsigned __int8 *)result->_achieved_awards_bits, 1);
       if ( !(short)result )
 		  __debugbreak();
         //result = (Player *)_449B7E_toggle_bit((unsigned char *)v10, 1, 1u);
@@ -2939,7 +2946,7 @@
 }
 
 //----- (004B1523) --------------------------------------------------------
-void __thiscall sub_4B1523(int *_this)
+void  sub_4B1523(int *_this)
 {
   int v1; // esi@1
   int v2; // edx@1
@@ -3009,7 +3016,7 @@
 }
 
 //----- (004B1ECE) --------------------------------------------------------
-void __cdecl sub_4B1ECE()
+void OracleDialogue()
 {
   __int16 *v0; // edi@1
   int v1; // ebx@3
@@ -3103,13 +3110,9 @@
 	  v9->uHolderPlayer = v5;
   }
 }
-// 4F08EC: using guessed type int dword_4F08EC[];
-// 722B3C: using guessed type int dword_722B3C;
-// 722B44: using guessed type int dword_722B44;
-// F8B1A8: using guessed type int dword_F8B1A8;
 
 //----- (004B254D) --------------------------------------------------------
-char *__thiscall _4B254D_SkillMasteryTeacher(int _this)
+char * _4B254D_SkillMasteryTeacher(int _this)
 {
   //Player *v1; // esi@1
   int v2; // edx@1
@@ -3485,7 +3488,7 @@
 }
 
 //----- (004B3E1E) --------------------------------------------------------
-void __cdecl sub_4B3E1E()
+void  sub_4B3E1E()
 {
   NPCData *v0; // ST40_4@1
   signed int v1; // edi@1
@@ -3506,7 +3509,6 @@
   pDialogueWindow->_41D08F_set_keyboard_control_group(v1 + 1, 1, 0, 1);
 }
 
-// F8B19C: using guessed type int dword_F8B19C;
 
 //----- (004B3FE5) --------------------------------------------------------
 void __fastcall sub_4B3FE5(int a4)
@@ -3544,13 +3546,13 @@
 }
 
 //----- (004B46F8) --------------------------------------------------------
-int __fastcall sub_4B46F8(int a1)
+__int64 GetExperienceRequiredForLevel(int level)
 {
-  int v1; // eax@1
+  __int64 v1; // eax@1
   int i; // edx@1
 
   v1 = 0;
-  for ( i = 0; i < a1; ++i )
+  for ( i = 0; i < level; ++i )
     v1 += i + 1;
   return 1000 * v1;
 }
@@ -3756,12 +3758,13 @@
 			switch ( npc_event_id )
 			{
 				case 139:
-					sub_4B1ECE();
+					OracleDialogue();
 					break;
 				case 311:
 					sub_4BBA85_bounties();
 					break;
 				case 399:
+                  __debugbreak(); // what kind of dialogue is that?
 					sub_4BBCDD();
 					break;
 				default: