Mercurial > mm7
comparison mm7_2.cpp @ 2099:7edf389d49fc
pCurrentPosActiveItem
author | Ritor1 |
---|---|
date | Fri, 13 Dec 2013 17:46:37 +0600 |
parents | 7810cb3a5fb7 |
children | ee2724b9ca05 |
comparison
equal
deleted
inserted
replaced
2098:7810cb3a5fb7 | 2099:7edf389d49fc |
---|---|
2812 } | 2812 } |
2813 | 2813 |
2814 //----- (004610AA) -------------------------------------------------------- | 2814 //----- (004610AA) -------------------------------------------------------- |
2815 void __fastcall PrepareToLoadODM(unsigned int bLoading, ODMRenderParams *a2) | 2815 void __fastcall PrepareToLoadODM(unsigned int bLoading, ODMRenderParams *a2) |
2816 { | 2816 { |
2817 unsigned int v2; // edi@1 | |
2818 ODMRenderParams *v3; // esi@1 | |
2819 | |
2820 v2 = bLoading; | |
2821 v3 = a2; | |
2822 pGameLoadingUI_ProgressBar->Reset(27); | 2817 pGameLoadingUI_ProgressBar->Reset(27); |
2823 pSoundList->_4A9D79(0); | 2818 pSoundList->_4A9D79(0); |
2824 uCurrentlyLoadedLevelType = LEVEL_Outdoor; | 2819 uCurrentlyLoadedLevelType = LEVEL_Outdoor; |
2825 ODM_LoadAndInitialize(pCurrentMapName, v3); | 2820 ODM_LoadAndInitialize(pCurrentMapName, a2); |
2826 if ( !v2 ) | 2821 if ( !bLoading ) |
2827 TeleportToStartingPoint(uLevel_StartingPointType); | 2822 TeleportToStartingPoint(uLevel_StartingPointType); |
2828 viewparams->_443365(); | 2823 viewparams->_443365(); |
2829 PlayLevelMusic(); | 2824 PlayLevelMusic(); |
2830 } | 2825 } |
2831 // 6BE35C: using guessed type int uLevel_StartingPointType; | 2826 // 6BE35C: using guessed type int uLevel_StartingPointType; |
2855 int v19; // [sp+18h] [bp-44h]@1 | 2850 int v19; // [sp+18h] [bp-44h]@1 |
2856 signed int v20; // [sp+18h] [bp-44h]@14 | 2851 signed int v20; // [sp+18h] [bp-44h]@14 |
2857 int v21[16]; // [sp+1Ch] [bp-40h]@17 | 2852 int v21[16]; // [sp+1Ch] [bp-40h]@17 |
2858 | 2853 |
2859 GenerateItemsInChest(); | 2854 GenerateItemsInChest(); |
2860 //v0 = pGameLoadingUI_ProgressBar; | |
2861 pGameLoadingUI_ProgressBar->Progress(); | 2855 pGameLoadingUI_ProgressBar->Progress(); |
2862 pParty->uFlags |= 2u; | 2856 pParty->uFlags |= 2u; |
2863 pParty->field_7B5_in_arena_quest = 0; | 2857 pParty->field_7B5_in_arena_quest = 0; |
2864 //v1 = 0; | |
2865 dword_5C6DF8 = 1; | 2858 dword_5C6DF8 = 1; |
2866 pNPCStats->uNewlNPCBufPos = 0; | 2859 pNPCStats->uNewlNPCBufPos = 0; |
2867 v19 = pMapStats->GetMapInfo(pCurrentMapName); | 2860 v19 = pMapStats->GetMapInfo(pCurrentMapName); |
2868 | 2861 |
2869 //v15 = 0; | 2862 //v15 = 0; |
2870 for (uint i = 0; i < uNumActors; ++i) | 2863 for (uint i = 0; i < uNumActors; ++i) |
2871 //if ( (signed int)uNumActors > 0 ) | 2864 //if ( (signed int)uNumActors > 0 ) |
2872 { | 2865 { |
2873 Actor* pActor = &pActors[i]; | 2866 //Actor* pActor = &pActors[i]; |
2874 //v2 = (char *)&pActors[0].uNPC_ID; | 2867 //v2 = (char *)&pActors[0].uNPC_ID; |
2875 //do | 2868 //do |
2876 //{ | 2869 //{ |
2877 v3 = pActor->pMonsterInfo.uID; | 2870 v3 = pActors[i].pMonsterInfo.uID; |
2878 v17 = 0; | 2871 v17 = 0; |
2879 if ( pActor->pMonsterInfo.uID >= 115 && pActor->pMonsterInfo.uID <= 186 | 2872 if ( pActors[i].pMonsterInfo.uID >= 115 && pActors[i].pMonsterInfo.uID <= 186 |
2880 || pActor->pMonsterInfo.uID >= 232 && pActor->pMonsterInfo.uID <= 249 ) | 2873 || pActors[i].pMonsterInfo.uID >= 232 && pActors[i].pMonsterInfo.uID <= 249 ) |
2881 v17 = 1; | 2874 v17 = 1; |
2882 //v1 = 0; | 2875 //v1 = 0; |
2883 v4 = (v3 - 1) % 3; | 2876 v4 = (v3 - 1) % 3; |
2884 if ( 2 == v4 ) | 2877 if ( 2 == v4 ) |
2885 { | 2878 { |
2886 if ( pActor->sNPC_ID && pActor->sNPC_ID < 5000 ) | 2879 if ( pActors[i].sNPC_ID && pActors[i].sNPC_ID < 5000 ) |
2887 continue; | 2880 continue; |
2888 } | 2881 } |
2889 else | 2882 else |
2890 { | 2883 { |
2891 if ( v4 != 1 ) | 2884 if ( v4 != 1 ) |
2892 { | 2885 { |
2893 if ( v4 == 0 && pActor->sNPC_ID == 0 ) | 2886 if ( v4 == 0 && pActors[i].sNPC_ID == 0 ) |
2894 pActor->sNPC_ID = 0; | 2887 pActors[i].sNPC_ID = 0; |
2895 continue; | 2888 continue; |
2896 } | 2889 } |
2897 } | 2890 } |
2898 if ( pActor->sNPC_ID > 0 && pActor->sNPC_ID < 5000 ) | 2891 if ( pActors[i].sNPC_ID > 0 && pActors[i].sNPC_ID < 5000 ) |
2899 continue; | 2892 continue; |
2900 if ( v17 ) | 2893 if ( v17 ) |
2901 { | 2894 { |
2902 pNPCStats->InitializeAdditionalNPCs(&pNPCStats->pAdditionalNPC[pNPCStats->uNewlNPCBufPos], v3, 0, v19); | 2895 pNPCStats->InitializeAdditionalNPCs(&pNPCStats->pAdditionalNPC[pNPCStats->uNewlNPCBufPos], v3, 0, v19); |
2903 v14 = LOWORD(pNPCStats->uNewlNPCBufPos) + 5000; | 2896 v14 = LOWORD(pNPCStats->uNewlNPCBufPos) + 5000; |
2904 ++pNPCStats->uNewlNPCBufPos; | 2897 ++pNPCStats->uNewlNPCBufPos; |
2905 pActor->sNPC_ID = v14; | 2898 pActors[i].sNPC_ID = v14; |
2906 continue; | 2899 continue; |
2907 } | 2900 } |
2908 pActor->sNPC_ID = 0; | 2901 pActors[i].sNPC_ID = 0; |
2909 //++v15; | 2902 //++v15; |
2910 //v2 += 836; | 2903 //v2 += 836; |
2911 //} | 2904 //} |
2912 //while ( v15 < (signed int)uNumActors ); | 2905 //while ( v15 < (signed int)uNumActors ); |
2913 } | 2906 } |
2919 v20 = 0; | 2912 v20 = 0; |
2920 //v16 = v1; | 2913 //v16 = v1; |
2921 | 2914 |
2922 for (uint i = 0; i < uNumActors; ++i) | 2915 for (uint i = 0; i < uNumActors; ++i) |
2923 { | 2916 { |
2924 Actor* pActor = &pActors[i]; | |
2925 //v7 = (char *)&pActors[0].pMonsterInfo; | 2917 //v7 = (char *)&pActors[0].pMonsterInfo; |
2926 //do | 2918 //do |
2927 //{ | 2919 //{ |
2928 v8 = 0; | 2920 v8 = 0; |
2929 if ( v6 > 0 ) | 2921 if ( v6 > 0 ) |
2930 { | 2922 { |
2931 do | 2923 do |
2932 { | 2924 { |
2933 if ( v21[v8] == pActor->pMonsterInfo.uID - 1 ) | 2925 if ( v21[v8] == pActors[i].pMonsterInfo.uID - 1 ) |
2934 break; | 2926 break; |
2935 ++v8; | 2927 ++v8; |
2936 } | 2928 } |
2937 while ( v8 < v6 ); | 2929 while ( v8 < v6 ); |
2938 } | 2930 } |
2939 | 2931 |
2940 if ( v8 == v6 ) | 2932 if ( v8 == v6 ) |
2941 { | 2933 { |
2942 v21[v6++] = pActor->pMonsterInfo.uID - 1; | 2934 v21[v6++] = pActors[i].pMonsterInfo.uID - 1; |
2943 v20 = v6; | 2935 v20 = v6; |
2944 if ( v6 == 16 ) | 2936 if ( v6 == 16 ) |
2945 break; | 2937 break; |
2946 } | 2938 } |
2947 //++v16; | 2939 //++v16; |