comparison mm7_5.cpp @ 456:20d96ec810c8

Слияние
author Ritor1
date Sun, 24 Feb 2013 13:53:18 +0600
parents 0a1ea44b4a0a
children e5cf03a3d98e
comparison
equal deleted inserted replaced
455:4c4584219da3 456:20d96ec810c8
75 //int v6; // edx@20 75 //int v6; // edx@20
76 //int v7; // ecx@29 76 //int v7; // ecx@29
77 unsigned int v8; // edx@59 77 unsigned int v8; // edx@59
78 unsigned int v9; // ecx@60 78 unsigned int v9; // ecx@60
79 unsigned int v10; // ecx@73 79 unsigned int v10; // ecx@73
80 unsigned int v11; // eax@75 80 //unsigned int v11; // eax@75
81 unsigned __int8 v12; // sf@75 81 unsigned __int8 v12; // sf@75
82 unsigned __int8 v13; // of@75 82 unsigned __int8 v13; // of@75
83 int v14; // eax@98 83 int v14; // eax@98
84 unsigned int v15; // eax@102 84 unsigned int v15; // eax@102
85 unsigned __int8 v16; // al@104 85 unsigned __int8 v16; // al@104
487 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam ) 487 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
488 { 488 {
489 v10 = pSaveListPosition + uMessageParam; 489 v10 = pSaveListPosition + uMessageParam;
490 if ( dword_6BE138 == pSaveListPosition + uMessageParam ) 490 if ( dword_6BE138 == pSaveListPosition + uMessageParam )
491 { 491 {
492 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 492 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadSlot, 0, 0);
493 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
494 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
493 { 495 {
494 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)164; 496 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_LoadSlot;
495 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 497 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
496 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 498 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
497 v11 = pMessageQueue_50CBD0->uNumMessages + 1; 499 //v11 = pMessageQueue_50CBD0->uNumMessages + 1;
498 v13 = pMessageQueue_50CBD0->uNumMessages + 1 > 40; 500 //v13 = pMessageQueue_50CBD0->uNumMessages + 1 > 40;
499 v12 = (signed int)pMessageQueue_50CBD0->uNumMessages - 39 < 0; 501 //v12 = (signed int)pMessageQueue_50CBD0->uNumMessages - 39 < 0;
500 ++pMessageQueue_50CBD0->uNumMessages; 502 ++pMessageQueue_50CBD0->uNumMessages;
501 if ( v12 ^ v13 ) 503 if ( v12 ^ v13 )
502 { 504 {
503 pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)82; 505 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_LoadGame;
504 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 506 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
505 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 507 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
506 ++pMessageQueue_50CBD0->uNumMessages; 508 ++pMessageQueue_50CBD0->uNumMessages;
507 } 509 }
508 } 510 }*/
509 } 511 }
510 uLoadGameUI_SelectedSlot = v10; 512 uLoadGameUI_SelectedSlot = v10;
511 dword_6BE138 = v10; 513 dword_6BE138 = v10;
512 } 514 }
513 else 515 else
1916 _5B65B0_npcdata_rep_or_other = v56; 1918 _5B65B0_npcdata_rep_or_other = v56;
1917 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57; 1919 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57;
1918 } 1920 }
1919 sub_4BD8B5(); 1921 sub_4BD8B5();
1920 //goto LABEL_434; 1922 //goto LABEL_434;
1921 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 1923 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
1922 { 1924 {
1923 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 1925 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
1924 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; 1926 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
1925 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 1927 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
1926 ++pMessageQueue_50CBD0->uNumMessages; 1928 ++pMessageQueue_50CBD0->uNumMessages;
1927 } 1929 }*/
1930 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v0, 0);
1928 continue; 1931 continue;
1929 case UIMSG_C3: 1932 case UIMSG_C3:
1930 pAudioPlayer->StopChannels(-1, -1); 1933 pAudioPlayer->StopChannels(-1, -1);
1931 v162 = uMessageParam; 1934 v162 = uMessageParam;
1932 v148 = 195; 1935 v148 = 195;
1985 sub_41C0B8_set_status_string(pTmpBuf); 1988 sub_41C0B8_set_status_string(pTmpBuf);
1986 continue; 1989 continue;
1987 case UIMSG_B5: 1990 case UIMSG_B5:
1988 dword_50CDC8 = v0; 1991 dword_50CDC8 = v0;
1989 //goto LABEL_453; 1992 //goto LABEL_453;
1990 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 1993 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
1994 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
1991 continue; 1995 continue;
1992 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 1996 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
1993 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 1997 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
1994 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 1998 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
1995 ++pMessageQueue_50CBD0->uNumMessages; 1999 ++pMessageQueue_50CBD0->uNumMessages;*/
1996 continue; 2000 continue;
1997 case UIMSG_B3: 2001 case UIMSG_B3:
1998 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; 2002 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1];
1999 pNPCData4 = (NPCData *)&pPlayer9->pInstalledBeacons[uMessageParam]; 2003 pNPCData4 = (NPCData *)&pPlayer9->pInstalledBeacons[uMessageParam];
2000 if ( !*(_QWORD *)&pNPCData4->pName && bRecallingBeacon ) 2004 if ( !*(_QWORD *)&pNPCData4->pName && bRecallingBeacon )
2036 pParty->vPosition.z = pNPCData4->rep; 2040 pParty->vPosition.z = pNPCData4->rep;
2037 pParty->uFallStartY = pParty->vPosition.z; 2041 pParty->uFallStartY = pParty->vPosition.z;
2038 pParty->sRotationY = LOWORD(pNPCData4->Location2D); 2042 pParty->sRotationY = LOWORD(pNPCData4->Location2D);
2039 pParty->sRotationX = HIWORD(pNPCData4->Location2D); 2043 pParty->sRotationX = HIWORD(pNPCData4->Location2D);
2040 } 2044 }
2041 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 2045 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v0, 0);
2046 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
2042 { 2047 {
2043 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; 2048 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
2044 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; 2049 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
2045 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 2050 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
2046 ++pMessageQueue_50CBD0->uNumMessages; 2051 ++pMessageQueue_50CBD0->uNumMessages;
2047 } 2052 }*/
2048 //crt_deconstruct_ptr_6A0118(); 2053 //crt_deconstruct_ptr_6A0118();
2049 pBooksWindow->Release(); 2054 pBooksWindow->Release();
2050 pGUIWindow_CurrentMenu->Release(); 2055 pGUIWindow_CurrentMenu->Release();
2051 pBooksWindow = 0; 2056 pBooksWindow = 0;
2052 pGUIWindow_CurrentMenu = 0; 2057 pGUIWindow_CurrentMenu = 0;
2133 if ( v67 ) 2138 if ( v67 )
2134 *((int *)v67 + 17) = v0; 2139 *((int *)v67 + 17) = v0;
2135 else 2140 else
2136 pParty->pPlayers[(unsigned __int8)byte_50C0C0].CanCastSpell(0x14u); 2141 pParty->pPlayers[(unsigned __int8)byte_50C0C0].CanCastSpell(0x14u);
2137 //LABEL_434: 2142 //LABEL_434:
2138 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 2143 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
2139 { 2144 {
2140 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 2145 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
2141 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; 2146 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
2142 //LABEL_771: 2147 //LABEL_771:
2143 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 2148 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
2144 ++pMessageQueue_50CBD0->uNumMessages; 2149 ++pMessageQueue_50CBD0->uNumMessages;
2145 } 2150 }*/
2151 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v0, 0);
2146 continue; 2152 continue;
2147 } 2153 }
2148 v63 = 210; 2154 v63 = 210;
2149 break; 2155 break;
2150 } 2156 }
2686 HIDWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0; 2692 HIDWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0;
2687 v95 = rand(); 2693 v95 = rand();
2688 Rest(v95 % 6 + 60); 2694 Rest(v95 % 6 + 60);
2689 _506F18_num_hours_to_sleep = 0; 2695 _506F18_num_hours_to_sleep = 0;
2690 dword_506F14 = 0; 2696 dword_506F14 = 0;
2691 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 2697 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
2692 { 2698 {
2693 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 2699 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
2694 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 2700 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
2695 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 2701 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
2696 ++pMessageQueue_50CBD0->uNumMessages; 2702 ++pMessageQueue_50CBD0->uNumMessages;
2697 } 2703 }*/
2704 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
2698 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2u);// "Encounter!" 2705 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2u);// "Encounter!"
2699 v165 = 0; 2706 v165 = 0;
2700 v151 = 0; 2707 v151 = 0;
2701 v144 = 0; 2708 v144 = 0;
2702 v139 = 0; 2709 v139 = 0;
2872 v135 = -1; 2879 v135 = -1;
2873 v132 = 0; 2880 v132 = 0;
2874 v130 = 0; 2881 v130 = 0;
2875 v127 = rand() % 2 + 204; 2882 v127 = rand() % 2 + 204;
2876 goto _play_sound_and_continue; 2883 goto _play_sound_and_continue;
2877 case UIMSG_56: 2884 case UIMSG_SelectSpell:
2878 if ( pTurnEngine->field_4 != 3 ) 2885 {
2879 { 2886 if (pTurnEngine->field_4 == 3)
2880 if ( uActiveCharacter ) 2887 continue;
2881 { 2888 if (!uActiveCharacter)
2882 uNumSeconds = (unsigned int)pPlayers[uActiveCharacter]; 2889 continue;
2883 if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402) ) 2890
2884 { 2891 // uNumSeconds = (unsigned int)pPlayers[uActiveCharacter];
2892 auto player = pPlayers[uActiveCharacter];
2893 if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam])
2894 //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) )
2895 {
2885 if ( dword_50654C - 1 == uMessageParam ) 2896 if ( dword_50654C - 1 == uMessageParam )
2886 { 2897 {
2887 pGUIWindow_CurrentMenu->Release(); 2898 pGUIWindow_CurrentMenu->Release();
2888 pEventTimer->Resume(); 2899 pEventTimer->Resume();
2889 viewparams->bRedrawGameUI = v0; 2900 viewparams->bRedrawGameUI = v0;
2890 pCurrentScreen = SCREEN_GAME; 2901 pCurrentScreen = SCREEN_GAME;
2891 pIcons_LOD->_4114F2(); 2902 pIcons_LOD->_4114F2();
2892 v103 = dword_50654C + 11 * *(char *)(uNumSeconds + 6734); 2903 v103 = dword_50654C + 11 * player->lastOpenedSpellbookPage;
2893 if ( dword_50C9E8 < 40 ) 2904 if ( dword_50C9E8 < 40 )
2894 { 2905 {
2895 dword_50C9EC[3 * dword_50C9E8] = 142; 2906 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook;
2896 dword_50C9F0[3 * dword_50C9E8] = v103; 2907 dword_50C9EC[3 * dword_50C9E8 + 1] = v103;
2897 *(&dword_50C9E8 + 3 * dword_50C9E8 + 3) = uActiveCharacter - 1; 2908 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1;
2898 ++dword_50C9E8; 2909 ++dword_50C9E8;
2899 } 2910 }
2900 } 2911 }
2901 else 2912 else
2902 { 2913 {
2903 byte_506550 = 1; 2914 byte_506550 = 1;
2904 dword_50654C = uMessageParam + 1; 2915 dword_50654C = uMessageParam + 1;
2905 } 2916 }
2906 } 2917 }
2907 } 2918 }
2908 } 2919 continue;
2909 continue;
2910 2920
2911 case UIMSG_CastSpellFromBook: 2921 case UIMSG_CastSpellFromBook:
2912 if ( pTurnEngine->field_4 != 3 ) 2922 if ( pTurnEngine->field_4 != 3 )
2913 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); 2923 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0);
2914 continue; 2924 continue;
3011 free((void *)uNumSeconds); 3021 free((void *)uNumSeconds);
3012 stru_506E40._40E55E("gamma.pcx", 0); 3022 stru_506E40._40E55E("gamma.pcx", 0);
3013 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0); 3023 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0);
3014 uNumVisibleWindows = uNumVisibleWindows - 1; //Ritor1: Insert 3024 uNumVisibleWindows = uNumVisibleWindows - 1; //Ritor1: Insert
3015 //LABEL_453: 3025 //LABEL_453:
3016 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 3026 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
3017 continue; 3027 continue;
3018 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 3028 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
3019 //goto LABEL_770; 3029 //goto LABEL_770;
3020 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 3030 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3021 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 3031 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3022 ++pMessageQueue_50CBD0->uNumMessages; 3032 ++pMessageQueue_50CBD0->uNumMessages;*/
3033 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
3023 continue; 3034 continue;
3024 case UIMSG_C0: 3035 case UIMSG_C0:
3025 dword_50651C = v0; 3036 dword_50651C = v0;
3026 if ( pMouse->GetCursorPos(&v211)->y > 178 ) 3037 if ( pMouse->GetCursorPos(&v211)->y > 178 )
3027 dword_50651C = -1; 3038 dword_50651C = -1;
3307 } 3318 }
3308 v115 = pMessageQueue_50CBD0->uNumMessages; 3319 v115 = pMessageQueue_50CBD0->uNumMessages;
3309 if ( !pMessageQueue_50CBD0->uNumMessages ) 3320 if ( !pMessageQueue_50CBD0->uNumMessages )
3310 //goto LABEL_768; 3321 //goto LABEL_768;
3311 { 3322 {
3312 if ( (signed int)v115 < 40 ) 3323 pMessageQueue_50CBD0->AddMessage(UIMSG_E, 0, 0);
3324 /*if ( (signed int)v115 < 40 )
3313 //goto LABEL_769; 3325 //goto LABEL_769;
3314 { 3326 {
3315 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14; 3327 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14;
3316 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 3328 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3317 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 3329 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3318 ++pMessageQueue_50CBD0->uNumMessages; 3330 ++pMessageQueue_50CBD0->uNumMessages;
3319 continue; 3331 continue;
3320 } 3332 }*/
3321 continue; 3333 continue;
3322 } 3334 }
3323 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) 3335 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
3324 { 3336 {
3325 v115 = v0; 3337 pMessageQueue_50CBD0->uNumMessages = v0;
3338 pMessageQueue_50CBD0->AddMessage(UIMSG_E, 0, 0);
3339 /*v115 = v0;
3326 pMessageQueue_50CBD0->uNumMessages = v0; 3340 pMessageQueue_50CBD0->uNumMessages = v0;
3327 //LABEL_769: 3341 //LABEL_769:
3328 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14; 3342 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14;
3329 //LABEL_770: 3343 //LABEL_770:
3330 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 3344 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3331 //goto LABEL_771; 3345 //goto LABEL_771;
3332 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 3346 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3333 ++pMessageQueue_50CBD0->uNumMessages; 3347 ++pMessageQueue_50CBD0->uNumMessages;*/
3334 continue; 3348 continue;
3335 } 3349 }
3336 v115 = 0; 3350 v115 = 0;
3337 pMessageQueue_50CBD0->uNumMessages = 0; 3351 pMessageQueue_50CBD0->uNumMessages = 0;
3338 //LABEL_768: 3352 //LABEL_768:
3339 if ( (signed int)v115 < 40 ) 3353 pMessageQueue_50CBD0->AddMessage(UIMSG_E, 0, 0);
3354 /*if ( (signed int)v115 < 40 )
3340 //goto LABEL_769; 3355 //goto LABEL_769;
3341 { 3356 {
3342 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14; 3357 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14;
3343 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 3358 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3344 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 3359 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3345 ++pMessageQueue_50CBD0->uNumMessages; 3360 ++pMessageQueue_50CBD0->uNumMessages;
3346 continue; 3361 continue;
3347 } 3362 }*/
3348 continue; 3363 continue;
3349 case UIMSG_E: 3364 case UIMSG_E:
3350 //LABEL_772: 3365 //LABEL_772:
3351 if ( pMessageQueue_50CBD0->uNumMessages ) 3366 if ( pMessageQueue_50CBD0->uNumMessages )
3352 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 3367 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
3453 pMessageQueue_50CBD0->uNumMessages = dword_50C9E8; 3468 pMessageQueue_50CBD0->uNumMessages = dword_50C9E8;
3454 memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8); 3469 memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8);
3455 dword_50C9E8 = 0; 3470 dword_50C9E8 = 0;
3456 if ( dword_50C9DC ) 3471 if ( dword_50C9DC )
3457 { 3472 {
3458 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 3473 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
3459 { 3474 {
3460 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC; 3475 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC;
3461 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0; 3476 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0;
3462 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 3477 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3463 ++pMessageQueue_50CBD0->uNumMessages; 3478 ++pMessageQueue_50CBD0->uNumMessages;
3464 } 3479 }*/
3480 pMessageQueue_50CBD0->AddMessage((UIMessageType)dword_50C9DC, (int)ptr_50C9E0, 0);
3465 dword_50C9DC = 0; 3481 dword_50C9DC = 0;
3466 } 3482 }
3467 else 3483 else
3468 { 3484 {
3469 if ( dword_50C9D0 > 0 ) 3485 if ( dword_50C9D0 > 0 )
3470 { 3486 {
3471 dword_50C9D8 -= pEventTimer->uTimeElapsed; 3487 dword_50C9D8 -= pEventTimer->uTimeElapsed;
3472 if ( dword_50C9D8 <= 0 ) 3488 if ( dword_50C9D8 <= 0 )
3473 { 3489 {
3474 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 3490 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
3475 { 3491 {
3476 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0; 3492 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0;
3477 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4; 3493 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4;
3478 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 3494 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3479 ++pMessageQueue_50CBD0->uNumMessages; 3495 ++pMessageQueue_50CBD0->uNumMessages;
3480 } 3496 }*/
3497 pMessageQueue_50CBD0->AddMessage((UIMessageType)dword_50C9D0, dword_50C9D4, 0);
3481 dword_50C9D0 = 0; 3498 dword_50C9D0 = 0;
3482 dword_50C9D4 = 0; 3499 dword_50C9D4 = 0;
3483 dword_50C9D8 = 0; 3500 dword_50C9D8 = 0;
3484 } 3501 }
3485 } 3502 }
3697 { 3714 {
3698 //load clicked line 3715 //load clicked line
3699 v26 = uNum + pSaveListPosition; 3716 v26 = uNum + pSaveListPosition;
3700 if ( dword_6BE138 == uNum + pSaveListPosition ) 3717 if ( dword_6BE138 == uNum + pSaveListPosition )
3701 { 3718 {
3702 pMessageQueue_50CBD0->SendMessage(UIMSG_LoadSlot, 0, 0); 3719 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadSlot, 0, 0);
3703 pMessageQueue_50CBD0->SendMessage(UIMSG_LoadGame, 0, 0); 3720 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
3704 } 3721 }
3705 uLoadGameUI_SelectedSlot = v26; 3722 uLoadGameUI_SelectedSlot = v26;
3706 dword_6BE138 = v26; 3723 dword_6BE138 = v26;
3707 } 3724 }
3708 else 3725 else
3775 pEventTimer->Resume(); 3792 pEventTimer->Resume();
3776 pCurrentScreen = SCREEN_GAME; 3793 pCurrentScreen = SCREEN_GAME;
3777 viewparams->bRedrawGameUI = 1; 3794 viewparams->bRedrawGameUI = 1;
3778 } 3795 }
3779 GUIWindow::Create(602, 450, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0); 3796 GUIWindow::Create(602, 450, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0);
3780 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 3797 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
3781 continue; 3798 continue;
3782 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; 3799 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
3783 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 3800 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3784 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 3801 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3785 ++pMessageQueue_50CBD0->uNumMessages; 3802 ++pMessageQueue_50CBD0->uNumMessages;*/
3803 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
3786 continue; 3804 continue;
3787 } 3805 }
3788 if ( pUIMessageType == UIMSG_Escape ) 3806 if ( pUIMessageType == UIMSG_Escape )
3789 { 3807 {
3790 if ( ptr_507BDC ) 3808 if ( ptr_507BDC )
3811 if (GetCurrentMenuID() == MENU_CREDITSPROC) 3829 if (GetCurrentMenuID() == MENU_CREDITSPROC)
3812 { 3830 {
3813 SetCurrentMenuID(MENU_CREDITSCLOSE); 3831 SetCurrentMenuID(MENU_CREDITSCLOSE);
3814 continue; 3832 continue;
3815 } 3833 }
3816 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 3834 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
3817 { 3835 {
3818 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)5; 3836 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)5;
3819 //LABEL_93: 3837 //LABEL_93:
3820 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 3838 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3821 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 3839 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3822 ++pMessageQueue_50CBD0->uNumMessages; 3840 ++pMessageQueue_50CBD0->uNumMessages;
3823 continue; 3841 continue;
3824 } 3842 }*/
3843 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0);
3825 continue; 3844 continue;
3826 } 3845 }
3827 v16 = GetCurrentMenuID() == 8; 3846 v16 = GetCurrentMenuID() == 8;
3828 if ( v16 && !pCurrentScreen ) 3847 if ( v16 && !pCurrentScreen )
3829 goto LABEL_83; 3848 goto LABEL_83;
13105 goto LABEL_24; 13124 goto LABEL_24;
13106 } 13125 }
13107 LABEL_30: 13126 LABEL_30:
13108 if ( byte_506360 ) 13127 if ( byte_506360 )
13109 { 13128 {
13110 result = pMessageQueue_50CBD0->uNumMessages; 13129 /*result = pMessageQueue_50CBD0->uNumMessages;
13111 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 13130 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
13112 { 13131 {
13113 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)181; 13132 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)181;
13114 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 13133 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
13115 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3; 13134 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
13116 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0; 13135 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
13117 ++pMessageQueue_50CBD0->uNumMessages; 13136 ++pMessageQueue_50CBD0->uNumMessages;
13118 } 13137 }*/
13138 pMessageQueue_50CBD0->AddMessage(UIMSG_B5, 0, 0);
13119 } 13139 }
13120 return result; 13140 return result;
13121 } 13141 }
13122 13142
13123 13143
14474 void __cdecl sub_41426F() 14494 void __cdecl sub_41426F()
14475 { 14495 {
14476 GUIWindow *v0; // ecx@1 14496 GUIWindow *v0; // ecx@1
14477 14497
14478 v0 = ptr_507BDC; 14498 v0 = ptr_507BDC;
14479 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 14499 pMessageQueue_50CBD0->AddMessage((UIMessageType)(int)ptr_507BDC->ptr_1C, 0, 0);
14500 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
14480 { 14501 {
14481 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)(int)ptr_507BDC->ptr_1C; 14502 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)(int)ptr_507BDC->ptr_1C;
14482 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 14503 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
14483 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 14504 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
14484 ++pMessageQueue_50CBD0->uNumMessages; 14505 ++pMessageQueue_50CBD0->uNumMessages;
14485 } 14506 }*/
14486 v0->Release(); 14507 v0->Release();
14487 ptr_507BDC = 0; 14508 ptr_507BDC = 0;
14488 pCurrentScreen = dword_506F0C[0]; 14509 pCurrentScreen = dword_506F0C[0];
14489 pEventTimer->Resume(); 14510 pEventTimer->Resume();
14490 } 14511 }
15089 viewparams->bRedrawGameUI = 1; 15110 viewparams->bRedrawGameUI = 1;
15090 if ( pHint && pHint != (char *)1 ) 15111 if ( pHint && pHint != (char *)1 )
15091 pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0); 15112 pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0);
15092 pWindow->Release(); 15113 pWindow->Release();
15093 if (pCurrentScreen == SCREEN_SAVEGAME) 15114 if (pCurrentScreen == SCREEN_SAVEGAME)
15094 pMessageQueue_50CBD0->SendMessage(UIMSG_SaveGame, 0, 0); 15115 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0);
15095 else 15116 else
15096 pMessageQueue_50CBD0->SendMessage(UIMSG_LoadGame, 0, 0); 15117 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
15097 } 15118 }
15098 continue; 15119 continue;
15099 } 15120 }
15100 if ( (signed int)pWindowType > 70 ) 15121 if ( (signed int)pWindowType > 70 )
15101 { 15122 {
15111 pHint = pWindow->Hint; 15132 pHint = pWindow->Hint;
15112 viewparams->bRedrawGameUI = 1; 15133 viewparams->bRedrawGameUI = 1;
15113 if ( pHint && pHint != (char *)1 ) 15134 if ( pHint && pHint != (char *)1 )
15114 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0); 15135 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0);
15115 pWindow->Release(); 15136 pWindow->Release();
15116 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 15137 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
15117 continue; 15138 continue;
15118 pNumMessages = pMessageQueue_50CBD0->uNumMessages; 15139 pNumMessages = pMessageQueue_50CBD0->uNumMessages;
15119 //LABEL_151: 15140 //LABEL_151:
15120 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; 15141 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113;
15121 //LABEL_152: 15142 //LABEL_152:
15122 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 15143 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
15123 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 15144 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
15124 ++pMessageQueue_50CBD0->uNumMessages; 15145 ++pMessageQueue_50CBD0->uNumMessages;*/
15146 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
15125 continue; 15147 continue;
15126 } 15148 }
15127 v34 = v33 - 1; 15149 v34 = v33 - 1;
15128 if ( v34 )//pWindowType > 97 15150 if ( v34 )//pWindowType > 97
15129 { 15151 {
15206 viewparams->bRedrawGameUI = 1; 15228 viewparams->bRedrawGameUI = 1;
15207 if ( pHint && pHint != (char *)1 ) 15229 if ( pHint && pHint != (char *)1 )
15208 ((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0); 15230 ((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0);
15209 pWindow->Release(); 15231 pWindow->Release();
15210 pNumMessages = pMessageQueue_50CBD0->uNumMessages; 15232 pNumMessages = pMessageQueue_50CBD0->uNumMessages;
15211 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 15233 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
15212 { 15234 {
15213 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; 15235 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113;
15214 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 15236 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
15215 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 15237 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
15216 ++pMessageQueue_50CBD0->uNumMessages; 15238 ++pMessageQueue_50CBD0->uNumMessages;
15217 continue; 15239 continue;
15218 } 15240 }*/
15241 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
15219 continue; 15242 continue;
15220 } 15243 }
15221 15244
15222 if ( pWindowType == WINDOW_5F ) 15245 if ( pWindowType == WINDOW_5F )
15223 { 15246 {
15231 if ( pHint && pHint != (char *)1 ) 15254 if ( pHint && pHint != (char *)1 )
15232 ((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0); 15255 ((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0);
15233 pWindow->Release(); 15256 pWindow->Release();
15234 //LABEL_142: 15257 //LABEL_142:
15235 pNumMessages = pMessageQueue_50CBD0->uNumMessages; 15258 pNumMessages = pMessageQueue_50CBD0->uNumMessages;
15236 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 15259 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
15237 //goto LABEL_151; 15260 //goto LABEL_151;
15238 { 15261 {
15239 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; //0x71 15262 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; //0x71
15240 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 15263 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
15241 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 15264 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
15242 ++pMessageQueue_50CBD0->uNumMessages; 15265 ++pMessageQueue_50CBD0->uNumMessages;
15243 continue; 15266 continue;
15244 } 15267 }*/
15268 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
15245 continue; 15269 continue;
15246 } 15270 }
15247 v14 = pWindowType - 80; 15271 v14 = pWindowType - 80;
15248 if ( v14 )//pWindowType > 80 15272 if ( v14 )//pWindowType > 80
15249 { 15273 {
15408 } 15432 }
15409 if ( ptr_507BD0->field_40 == 2 ) 15433 if ( ptr_507BD0->field_40 == 2 )
15410 { 15434 {
15411 v29 = pMessageQueue_50CBD0->uNumMessages; 15435 v29 = pMessageQueue_50CBD0->uNumMessages;
15412 pWindow->field_40 = 0; 15436 pWindow->field_40 = 0;
15413 if ( (signed int)v29 < 40 ) 15437 /*if ( (signed int)v29 < 40 )
15414 { 15438 {
15415 pMessageQueue_50CBD0->pMessages[v29].eType = (UIMessageType)(int)ptr_507BD0->ptr_1C; 15439 pMessageQueue_50CBD0->pMessages[v29].eType = (UIMessageType)(int)ptr_507BD0->ptr_1C;
15416 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 15440 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
15417 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 15441 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
15418 ++pMessageQueue_50CBD0->uNumMessages; 15442 ++pMessageQueue_50CBD0->uNumMessages;
15419 } 15443 }*/
15444 pMessageQueue_50CBD0->AddMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0);
15420 pEventTimer->Resume(); 15445 pEventTimer->Resume();
15421 ptr_507BD0->Release(); 15446 ptr_507BD0->Release();
15422 pCurrentScreen = SCREEN_GAME; 15447 pCurrentScreen = SCREEN_GAME;
15423 //goto LABEL_114; 15448 //goto LABEL_114;
15424 viewparams->bRedrawGameUI = 1; 15449 viewparams->bRedrawGameUI = 1;
15536 } 15561 }
15537 continue; 15562 continue;
15538 } 15563 }
15539 //goto LABEL_142; 15564 //goto LABEL_142;
15540 pNumMessages = pMessageQueue_50CBD0->uNumMessages; 15565 pNumMessages = pMessageQueue_50CBD0->uNumMessages;
15541 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 15566 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
15542 { 15567 {
15543 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; 15568 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113;
15544 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 15569 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
15545 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 15570 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
15546 ++pMessageQueue_50CBD0->uNumMessages; 15571 ++pMessageQueue_50CBD0->uNumMessages;
15547 continue; 15572 continue;
15548 } 15573 }*/
15574 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
15549 continue; 15575 continue;
15550 } 15576 }
15551 if ( pWindowType == WINDOW_SpellBook ) 15577 if ( pWindowType == WINDOW_SpellBook )
15552 { 15578 {
15553 DrawSpellBookContent(); 15579 DrawSpellBookContent();
15904 { 15930 {
15905 v0->RemoveItemAtInventoryIndex(v18); 15931 v0->RemoveItemAtInventoryIndex(v18);
15906 v26 = rand(); 15932 v26 = rand();
15907 v0->ReceiveDamage(v26 % 11 + 10, 0); 15933 v0->ReceiveDamage(v26 % 11 + 10, 0);
15908 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); 15934 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
15909 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 15935
15936 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
15937 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
15910 { 15938 {
15911 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 15939 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
15912 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 15940 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
15913 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 15941 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
15914 ++pMessageQueue_50CBD0->uNumMessages; 15942 ++pMessageQueue_50CBD0->uNumMessages;
15915 } 15943 }*/
15916 v42 = (int *)&a2.y; 15944 v42 = (int *)&a2.y;
15917 v41 = (int *)&y.y; 15945 v41 = (int *)&y.y;
15918 v40 = (int *)&pOut; 15946 v40 = (int *)&pOut;
15919 v39.z = pParty->vPosition.z + pParty->sEyelevel; 15947 v39.z = pParty->vPosition.z + pParty->sEyelevel;
15920 } 15948 }
15978 v23 = 0; 16006 v23 = 0;
15979 } 16007 }
15980 } 16008 }
15981 v0->_4160CA(v23); 16009 v0->_4160CA(v23);
15982 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); 16010 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
15983 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 16011
16012 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
16013 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
15984 { 16014 {
15985 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 16015 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
15986 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 16016 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
15987 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 16017 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
15988 ++pMessageQueue_50CBD0->uNumMessages; 16018 ++pMessageQueue_50CBD0->uNumMessages;
15989 } 16019 }*/
15990 v42 = (int *)&a2.y; 16020 v42 = (int *)&a2.y;
15991 v41 = (int *)&y.y; 16021 v41 = (int *)&y.y;
15992 v40 = (int *)&pOut; 16022 v40 = (int *)&pOut;
15993 v39.z = pParty->vPosition.z + pParty->sEyelevel; 16023 v39.z = pParty->vPosition.z + pParty->sEyelevel;
15994 } 16024 }
16634 { 16664 {
16635 v10 = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 16665 v10 = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
16636 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 16666 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
16637 } 16667 }
16638 //v11 = i->uControlParam; 16668 //v11 = i->uControlParam;
16639 pMessageQueue_50CBD0->SendMessage((UIMessageType)i->uControlID, i->uControlParam, 0); 16669 pMessageQueue_50CBD0->AddMessage((UIMessageType)i->uControlID, i->uControlParam, 0);
16640 return; 16670 return;
16641 } 16671 }
16642 goto LABEL_45; 16672 goto LABEL_45;
16643 } 16673 }
16644 y = pY; 16674 y = pY;
16653 && uActiveCharacter 16683 && uActiveCharacter
16654 && v5 < 33554432 16684 && v5 < 33554432
16655 && pPlayers[uActiveCharacter]->CanAct() 16685 && pPlayers[uActiveCharacter]->CanAct()
16656 && pPlayers[uActiveCharacter]->CanSteal() ) 16686 && pPlayers[uActiveCharacter]->CanSteal() )
16657 { 16687 {
16658 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 16688 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
16659 { 16689 {
16660 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)27; 16690 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)27;
16661 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6 >> 3; 16691 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6 >> 3;
16662 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 16692 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
16663 ++pMessageQueue_50CBD0->uNumMessages; 16693 ++pMessageQueue_50CBD0->uNumMessages;
16664 } 16694 }*/
16695 pMessageQueue_50CBD0->AddMessage(UIMSG_1B, v6 >> 3, 0);
16696
16665 if ( pParty->bTurnBasedModeOn == 1 ) 16697 if ( pParty->bTurnBasedModeOn == 1 )
16666 { 16698 {
16667 if ( pTurnEngine->field_4 == 3 ) 16699 if ( pTurnEngine->field_4 == 3 )
16668 pTurnEngine->field_18 |= 8u; 16700 pTurnEngine->field_18 |= 8u;
16669 } 16701 }