comparison mm7_6.cpp @ 998:e4383e6dfbef

ProcessInput
author Ritor1
date Tue, 14 May 2013 17:37:24 +0600
parents 1c13fbaad0c5
children 9318dd3f3711
comparison
equal deleted inserted replaced
997:1c13fbaad0c5 998:e4383e6dfbef
2273 if ( a5 & 2 ) 2273 if ( a5 & 2 )
2274 { 2274 {
2275 if ( pGUIWindow_Settings ) 2275 if ( pGUIWindow_Settings )
2276 return; 2276 return;
2277 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0); 2277 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
2278 pGUIWindow_Settings->CreateButton(52, 422, 35, 0, 2, 0, UIMSG_CastSpell_SPIRIT_Preservation, 0, 49, "", 0); 2278 pGUIWindow_Settings->CreateButton(52, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 0, 49, "", 0);
2279 pGUIWindow_Settings->CreateButton(165, 422, 35, 0, 2, 0, UIMSG_CastSpell_SPIRIT_Preservation, 1, 50, "", 0); 2279 pGUIWindow_Settings->CreateButton(165, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 1, 50, "", 0);
2280 pGUIWindow_Settings->CreateButton(280, 422, 35, 0, 2, 0, UIMSG_CastSpell_SPIRIT_Preservation, 2, 51, "", 0); 2280 pGUIWindow_Settings->CreateButton(280, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 2, 51, "", 0);
2281 pGUIWindow_Settings->CreateButton(390, 422, 35, 0, 2, 0, UIMSG_CastSpell_SPIRIT_Preservation, 3, 52, "", 0); 2281 pGUIWindow_Settings->CreateButton(390, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 3, 52, "", 0);
2282 sub_421B2C_PlaceInInventory_or_DropPickedItem(); 2282 sub_421B2C_PlaceInInventory_or_DropPickedItem();
2283 return; 2283 return;
2284 } 2284 }
2285 if ( a5 & 8 ) 2285 if ( a5 & 8 )
2286 { 2286 {
2287 if ( pGUIWindow_Settings ) 2287 if ( pGUIWindow_Settings )
2288 return; 2288 return;
2289 2289
2290 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0); 2290 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
2291 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_SmallShot, 0, 0, "", 0); 2291 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Shoot_Monster, 0, 0, "", 0);
2292 sub_421B2C_PlaceInInventory_or_DropPickedItem(); 2292 sub_421B2C_PlaceInInventory_or_DropPickedItem();
2293 return; 2293 return;
2294 } 2294 }
2295 if ( a5 & 0x40 ) 2295 if ( a5 & 0x40 )
2296 { 2296 {
2318 if ( HIBYTE(a5) & 1 ) 2318 if ( HIBYTE(a5) & 1 )
2319 { 2319 {
2320 if ( pGUIWindow_Settings ) 2320 if ( pGUIWindow_Settings )
2321 return; 2321 return;
2322 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0); 2322 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
2323 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_SPIRIT_Fate, 0, 0x31u, "", 0); 2323 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 0, 0x31u, "", 0);
2324 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_SPIRIT_Fate, 1, 0x32u, "", 0); 2324 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 1, 0x32u, "", 0);
2325 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_SPIRIT_Fate, 2, 0x33u, "", 0); 2325 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 2, 0x33u, "", 0);
2326 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_SPIRIT_Fate, 3, 0x34u, "", 0); 2326 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 3, 0x34u, "", 0);
2327 pGUIWindow_Settings->CreateButton(8, 8, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_GreatShot, 0, 0, "", NULL); 2327 pGUIWindow_Settings->CreateButton(8, 8, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Monster_Improvement, 0, 0, "", NULL);
2328 sub_421B2C_PlaceInInventory_or_DropPickedItem(); 2328 sub_421B2C_PlaceInInventory_or_DropPickedItem();
2329 } 2329 }
2330 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) 2330 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings )
2331 { 2331 {
2332 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0); 2332 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
2338 pBtn_NPCRight = pGUIWindow_Settings->CreateButton(626, 178, 2338 pBtn_NPCRight = pGUIWindow_Settings->CreateButton(626, 178,
2339 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth, 2339 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth,
2340 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight, 2340 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight,
2341 1, 0, UIMSG_ScrollNPCPanel, 1, 0, "", 2341 1, 0, UIMSG_ScrollNPCPanel, 1, 0, "",
2342 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0); 2342 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0);
2343 pGUIWindow_Settings->CreateButton(0x1EBu, 149, 64, 74, 1, 0, UIMSG_CastSpell_8F, 4, 0x35u, "", 0); 2343 pGUIWindow_Settings->CreateButton(491, 149, 64, 74, 1, 0, UIMSG_HiredNPC_CastSpell, 4, 0x35u, "", 0);
2344 pGUIWindow_Settings->CreateButton(0x231u, 149, 64, 74, 1, 0, UIMSG_CastSpell_8F, 5, 0x36u, "", 0); 2344 pGUIWindow_Settings->CreateButton(561, 149, 64, 74, 1, 0, UIMSG_HiredNPC_CastSpell, 5, 0x36u, "", 0);
2345 } 2345 }
2346 } 2346 }
2347 } 2347 }
2348 2348
2349 //----- (00427D48) -------------------------------------------------------- 2349 //----- (00427D48) --------------------------------------------------------
2424 //signed int v12; // ecx@48 2424 //signed int v12; // ecx@48
2425 //int v13; // eax@53 2425 //int v13; // eax@53
2426 unsigned __int8 v14; // zf@53 2426 unsigned __int8 v14; // zf@53
2427 //unsigned int v15; // edx@53 2427 //unsigned int v15; // edx@53
2428 //signed int v16; // eax@53 2428 //signed int v16; // eax@53
2429 Player *v17; // esi@70 2429 //Player *v17; // esi@70
2430 //int v18; // eax@72 2430 //int v18; // eax@72
2431 //int v19; // eax@74 2431 //int v19; // eax@74
2432 Player *v20; // eax@74 2432 Player *v20; // eax@74
2433 signed int i; // esi@76 2433 signed int i; // esi@76
2434 //int v22; // eax@88 2434 //int v22; // eax@88
3299 { 3299 {
3300 case SPELL_101: 3300 case SPELL_101:
3301 assert(false && "Unknown spell effect #101 (prolly flaming bow arrow"); 3301 assert(false && "Unknown spell effect #101 (prolly flaming bow arrow");
3302 case SPELL_BOW_ARROW: 3302 case SPELL_BOW_ARROW:
3303 { 3303 {
3304 v17 = pPlayer; 3304 //v17 = pPlayer;
3305 _this = (ItemGen *)1; 3305 _this = (ItemGen *)1;
3306 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[PLAYER_SKILL_BOW]) >= 3 ) 3306 if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[PLAYER_SKILL_BOW]) >= 3 )
3307 _this = (ItemGen *)2; 3307 _this = (ItemGen *)2;
3308 sRecoveryTime = v17->GetAttackRecoveryTime(true); 3308 sRecoveryTime = pPlayer->GetAttackRecoveryTime(true);
3309 pSpellSprite.stru_24.Reset(); 3309 pSpellSprite.stru_24.Reset();
3310 pSpellSprite.spell_level = v2; 3310 pSpellSprite.spell_level = v2;
3311 pSpellSprite.spell_id = pCastSpell->spellnum; 3311 pSpellSprite.spell_id = pCastSpell->spellnum;
3312 pSpellSprite.spell_skill = v731; 3312 pSpellSprite.spell_skill = v731;
3313 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); 3313 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
3314 if ( v17->WearsItem(510, 2) ) 3314 if ( pPlayer->WearsItem(510, 2) )
3315 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); 3315 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u);
3316 pSpellSprite.vPosition.x = pParty->vPosition.x; 3316 pSpellSprite.vPosition.x = pParty->vPosition.x;
3317 pSpellSprite.vPosition.y = pParty->vPosition.y; 3317 pSpellSprite.vPosition.y = pParty->vPosition.y;
3318 pSpellSprite.uAttributes = 0; 3318 pSpellSprite.uAttributes = 0;
3319 pSpellSprite.uSpriteFrameID = 0; 3319 pSpellSprite.uSpriteFrameID = 0;
8504 } 8504 }
8505 8505
8506 //----- (0042FC4E) -------------------------------------------------------- 8506 //----- (0042FC4E) --------------------------------------------------------
8507 void __cdecl ProcessInputActions() 8507 void __cdecl ProcessInputActions()
8508 { 8508 {
8509 ActionQueue *pActionQueue; // esi@7
8510 //Keyboard *v3; // ecx@8
8511 char v4; // al@9 8509 char v4; // al@9
8512 ActionQueue *v5; // ecx@19
8513 Player *v6; // ecx@86
8514 Player *v7; // esi@100
8515 char v8; // bl@100 8510 char v8; // bl@100
8516 unsigned __int16 v9; // ax@102 8511 unsigned __int16 v9; // ax@102
8517 int v10; // eax@103 8512 int v10; // eax@103
8518 unsigned int v11; // eax@127
8519 signed int v12; // esi@157
8520 Keyboard *v13; // ecx@158
8521 char v14; // al@159 8513 char v14; // al@159
8522 unsigned int v15; // eax@168 8514 unsigned int v15; // eax@168
8523 void *v16; // esi@177
8524 int v17; // [sp-14h] [bp-1Ch]@8
8525 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 8515 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20
8526 PartyAction partyAction_; // [sp-14h] [bp-1Ch]@54
8527 //__int16 v20; // [sp-14h] [bp-1Ch]@60
8528 int v21; // [sp-14h] [bp-1Ch]@68
8529 int v22; // [sp-Ch] [bp-14h]@158
8530 InputAction inputAction; // [sp+0h] [bp-8h]@7 8516 InputAction inputAction; // [sp+0h] [bp-8h]@7
8531 int v24; // [sp+4h] [bp-4h]@87 8517 int v24; // [sp+4h] [bp-4h]@87
8532 8518
8533 pGame->pKeyboardInstance->EnterCriticalSection(); 8519 pGame->pKeyboardInstance->EnterCriticalSection();
8534 auto pKeyboard = pGame->pKeyboardInstance; 8520 auto pKeyboard = pGame->pKeyboardInstance;
8546 else 8532 else
8547 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; 8533 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
8548 } 8534 }
8549 8535
8550 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; 8536 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
8551 //LABEL_6: 8537 for ( uint i = 0; i < 30; ++i )
8538 {
8539 if ( pKeyActionMap->pToggleTypes[i] )
8540 v14 = pGame->pKeyboardInstance->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[i]);
8541 else
8542 v14 = pGame->pKeyboardInstance->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[i]);
8543 if ( v14 && i == 9 )
8544 {
8545 if ( !pCurrentScreen )
8546 {
8547 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0);
8548 continue;
8549 }
8550 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
8551 {
8552 v15 = pMessageQueue_50CBD0->uNumMessages;
8553 if ( pMessageQueue_50CBD0->uNumMessages )
8554 {
8555 v15 = 0;
8556 if ( pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 )
8557 {
8558 v15 = 1;
8559 pMessageQueue_50CBD0->uNumMessages = 0;
8560 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape;
8561 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8562 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8563 ++pMessageQueue_50CBD0->uNumMessages;
8564 continue;
8565 }
8566 pMessageQueue_50CBD0->uNumMessages = 0;
8567 }
8568 //pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
8569 }
8570 }
8571 }
8552 if ( !pEventTimer->bPaused ) 8572 if ( !pEventTimer->bPaused )
8553 { 8573 {
8554 inputAction = (InputAction)0; 8574 for ( uint i = 0; i < 30; ++i )
8555 pActionQueue = pPartyActionQueue;
8556 while ( 1 )
8557 { 8575 {
8558 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; 8576 inputAction = (InputAction)i;
8559 if ( pKeyActionMap->pToggleTypes[inputAction] ) 8577 if ( pKeyActionMap->pToggleTypes[(InputAction)i] )
8560 v4 = pKeyboard->WasKeyPressed(v17); 8578 v4 = pKeyboard->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[(InputAction)i]);
8561 else 8579 else
8562 v4 = pKeyboard->IsKeyBeingHeld(v17); 8580 v4 = pKeyboard->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[(InputAction)i]);
8563 if ( v4 ) 8581 if ( v4 )
8564 { 8582 {
8565 switch ( inputAction ) 8583 switch ( inputAction )
8566 { 8584 {
8567 case INPUT_MoveForward: 8585 case INPUT_MoveForward:
8568 if (pCurrentScreen != SCREEN_GAME) 8586 if (pCurrentScreen != SCREEN_GAME)
8569 break; 8587 break;
8570 if (!pParty->bTurnBasedModeOn) 8588 if (!pParty->bTurnBasedModeOn)
8571 //goto _do_move_forward;
8572 { 8589 {
8573 v5 = pActionQueue;
8574 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) 8590 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
8575 partyAction = PARTY_RunForward; 8591 partyAction = PARTY_RunForward;
8576 else 8592 else
8577 partyAction = PARTY_WalkForward; 8593 partyAction = PARTY_WalkForward;
8578 //goto _add_action_and_continue; 8594 pPartyActionQueue->Add(partyAction);
8579 v5->Add(partyAction);
8580 break; 8595 break;
8581 } 8596 }
8582 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) 8597 if (pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
8583 { 8598 {
8584 pTurnEngine->uActionPointsLeft -= 26; 8599 pTurnEngine->uActionPointsLeft -= 26;
8585 //_do_move_forward:
8586 v5 = pActionQueue;
8587 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) 8600 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
8588 partyAction = PARTY_RunForward; 8601 partyAction = PARTY_RunForward;
8589 else 8602 else
8590 partyAction = PARTY_WalkForward; 8603 partyAction = PARTY_WalkForward;
8591 //goto _add_action_and_continue; 8604 pPartyActionQueue->Add(partyAction);
8592 v5->Add(partyAction);
8593 break; 8605 break;
8594 } 8606 }
8595 break; 8607 break;
8596 case INPUT_MoveBackwards: 8608 case INPUT_MoveBackwards:
8597 //__debugbreak();
8598 if (pCurrentScreen != SCREEN_GAME) 8609 if (pCurrentScreen != SCREEN_GAME)
8599 break; 8610 break;
8600 if (!pParty->bTurnBasedModeOn) 8611 if (!pParty->bTurnBasedModeOn)
8601 //goto _do_move_backwards;
8602 { 8612 {
8603 v5 = pActionQueue;
8604 if ( pParty->uFlags2 & 2 ) 8613 if ( pParty->uFlags2 & 2 )
8605 partyAction = PARTY_RunBackward; 8614 partyAction = PARTY_RunBackward;
8606 else 8615 else
8607 partyAction = PARTY_WalkBackward; 8616 partyAction = PARTY_WalkBackward;
8608 //goto _add_action_and_continue; 8617 pPartyActionQueue->Add(partyAction);
8609 v5->Add(partyAction);
8610 break; 8618 break;
8611 } 8619 }
8612 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 ) 8620 if ( pTurnEngine->field_4 != 1 && pTurnEngine->field_4 != 2 && pTurnEngine->uActionPointsLeft > 0 )
8613 { 8621 {
8614 pTurnEngine->uActionPointsLeft -= 26; 8622 pTurnEngine->uActionPointsLeft -= 26;
8615 //_do_move_backwards:
8616 v5 = pActionQueue;
8617 if ( pParty->uFlags2 & 2 ) 8623 if ( pParty->uFlags2 & 2 )
8618 partyAction = PARTY_RunBackward; 8624 partyAction = PARTY_RunBackward;
8619 else 8625 else
8620 partyAction = PARTY_WalkBackward; 8626 partyAction = PARTY_WalkBackward;
8621 //goto _add_action_and_continue; 8627 pPartyActionQueue->Add(partyAction);
8622 v5->Add(partyAction);
8623 break; 8628 break;
8624 } 8629 }
8625 break; 8630 break;
8626 case INPUT_StrafeLeft: 8631 case INPUT_StrafeLeft:
8627 //__debugbreak();
8628 if (pCurrentScreen != SCREEN_GAME) 8632 if (pCurrentScreen != SCREEN_GAME)
8629 break; 8633 break;
8630 if (!pParty->bTurnBasedModeOn) 8634 if (!pParty->bTurnBasedModeOn)
8631 //goto _do_strafe_left;
8632 { 8635 {
8633 partyAction = PARTY_StrafeLeft; 8636 partyAction = PARTY_StrafeLeft;
8634 //goto _add_action_and_continue_; 8637 pPartyActionQueue->Add(partyAction);
8635 v5 = pActionQueue;
8636 v5->Add(partyAction);
8637 break; 8638 break;
8638 } 8639 }
8639 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) 8640 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
8640 break; 8641 break;
8641 pTurnEngine->uActionPointsLeft -= 26; 8642 pTurnEngine->uActionPointsLeft -= 26;
8642 //_do_strafe_left:
8643 partyAction = PARTY_StrafeLeft; 8643 partyAction = PARTY_StrafeLeft;
8644 //goto _add_action_and_continue_; 8644 pPartyActionQueue->Add(partyAction);
8645 v5 = pActionQueue; 8645 break;
8646 v5->Add(partyAction);
8647 break;
8648 case INPUT_StrafeRight: 8646 case INPUT_StrafeRight:
8649 //__debugbreak();
8650 if (pCurrentScreen != SCREEN_GAME) 8647 if (pCurrentScreen != SCREEN_GAME)
8651 break; 8648 break;
8652 if (!pParty->bTurnBasedModeOn) 8649 if (!pParty->bTurnBasedModeOn)
8653 //goto _do_strafe_right;
8654 { 8650 {
8655 partyAction = PARTY_StrafeRight; 8651 partyAction = PARTY_StrafeRight;
8656 //goto _add_action_and_continue_; 8652 pPartyActionQueue->Add(partyAction);
8657 v5 = pActionQueue;
8658 v5->Add(partyAction);
8659 break; 8653 break;
8660 } 8654 }
8661 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) 8655 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
8662 break; 8656 break;
8663 pTurnEngine->uActionPointsLeft -= 26; 8657 pTurnEngine->uActionPointsLeft -= 26;
8664 //_do_strafe_right:
8665 partyAction = PARTY_StrafeRight; 8658 partyAction = PARTY_StrafeRight;
8666 //goto _add_action_and_continue_; 8659 pPartyActionQueue->Add(partyAction);
8667 v5 = pActionQueue;
8668 v5->Add(partyAction);
8669 break; 8660 break;
8670 case INPUT_TurnLeft: 8661 case INPUT_TurnLeft:
8671 if (pCurrentScreen != SCREEN_GAME) 8662 if (pCurrentScreen != SCREEN_GAME)
8672 break; 8663 break;
8673 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing 8664 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing
8676 { 8667 {
8677 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) 8668 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
8678 break; 8669 break;
8679 pTurnEngine->uActionPointsLeft -= 26; 8670 pTurnEngine->uActionPointsLeft -= 26;
8680 } 8671 }
8681 partyAction_ = PARTY_StrafeLeft; 8672 partyAction = PARTY_StrafeLeft;
8682 } 8673 }
8683 else 8674 else
8684 { 8675 {
8685 if ( pParty->uFlags2 & 2 ) 8676 if ( pParty->uFlags2 & 2 )
8686 partyAction_ = PARTY_FastTurnLeft; 8677 partyAction = PARTY_FastTurnLeft;
8687 else 8678 else
8688 partyAction_ = PARTY_TurnLeft; 8679 partyAction = PARTY_TurnLeft;
8689 } 8680 }
8690 pActionQueue->Add(partyAction_); 8681 pPartyActionQueue->Add(partyAction);
8691 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) 8682 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
8692 { 8683 {
8693 pWeather->OnPlayerTurn(10); 8684 pWeather->OnPlayerTurn(10);
8694 } 8685 }
8695 break; 8686 break;
8702 { 8693 {
8703 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 ) 8694 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 2 || pTurnEngine->uActionPointsLeft <= 0 )
8704 break; 8695 break;
8705 pTurnEngine->uActionPointsLeft -= 26; 8696 pTurnEngine->uActionPointsLeft -= 26;
8706 } 8697 }
8707 v21 = PARTY_StrafeRight; 8698 partyAction = PARTY_StrafeRight;
8708 } 8699 }
8709 else 8700 else
8710 { 8701 {
8711 if ( pParty->uFlags2 & 2 ) 8702 if ( pParty->uFlags2 & 2 )
8712 v21 = PARTY_FastTurnRight; 8703 partyAction = PARTY_FastTurnRight;
8713 else 8704 else
8714 v21 = PARTY_TurnRight; 8705 partyAction = PARTY_TurnRight;
8715 } 8706 }
8716 pActionQueue->Add((PartyAction)v21); 8707 pPartyActionQueue->Add(partyAction);
8717 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) 8708 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
8718 { 8709 {
8719 pWeather->OnPlayerTurn(-10); 8710 pWeather->OnPlayerTurn(-10);
8720 } 8711 }
8721 break; 8712 break;
8722 case INPUT_Jump: 8713 case INPUT_Jump:
8723 //__debugbreak();
8724 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) 8714 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn)
8725 break; 8715 break;
8726 partyAction = (PartyAction)12; 8716 partyAction = (PartyAction)12;
8727 //goto _add_action_and_continue_; 8717 pPartyActionQueue->Add(partyAction);
8728 v5 = pActionQueue;
8729 v5->Add(partyAction);
8730 break; 8718 break;
8731 case INPUT_Yell: 8719 case INPUT_Yell:
8732 if (!pCurrentScreen && uActiveCharacter) 8720 if (!pCurrentScreen && uActiveCharacter)
8733 { 8721 {
8734 pParty->Yell(); 8722 pParty->Yell();
8735 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); 8723 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0);
8736 } 8724 }
8737 break; 8725 break;
8738 case INPUT_Pass: 8726 case INPUT_Pass:
8739 //__debugbreak();
8740 if ( pCurrentScreen ) 8727 if ( pCurrentScreen )
8741 break; 8728 break;
8742 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) 8729 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3)
8743 //goto LABEL_118;
8744 { 8730 {
8745 pTurnEngine->field_18 |= 8u; 8731 pTurnEngine->field_18 |= 8u;
8746 break; 8732 break;
8747 } 8733 }
8748 if ( uActiveCharacter ) 8734 if ( uActiveCharacter )
8749 { 8735 {
8750 v6 = pPlayers[uActiveCharacter]; 8736 if ( !pPlayers[uActiveCharacter]->uTimeToRecovery )
8751 if ( !v6->uTimeToRecovery )
8752 { 8737 {
8753 v24 = v6->GetAttackRecoveryTime(false); 8738 v24 = pPlayers[uActiveCharacter]->GetAttackRecoveryTime(false);
8754 if ( !pParty->bTurnBasedModeOn ) 8739 if ( !pParty->bTurnBasedModeOn )
8755 pPlayers[uActiveCharacter]->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); 8740 pPlayers[uActiveCharacter]->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333));
8756 pCastSpellInfo->_427D48(uActiveCharacter); 8741 pCastSpellInfo->_427D48(uActiveCharacter);
8757 pTurnEngine->_40471C(); 8742 pTurnEngine->_40471C();
8758 } 8743 }
8759 } 8744 }
8760 break; 8745 break;
8761 case INPUT_Combat: 8746 case INPUT_Combat://if press ENTER
8762 //__debugbreak();
8763 if (pCurrentScreen == SCREEN_GAME) 8747 if (pCurrentScreen == SCREEN_GAME)
8764 { 8748 {
8765 if (pParty->bTurnBasedModeOn) 8749 if (pParty->bTurnBasedModeOn)
8766 { 8750 {
8767 if (pTurnEngine->field_4 == OBJECT_Actor || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) 8751 if (pTurnEngine->field_4 == OBJECT_Actor || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player)
8776 pParty->bTurnBasedModeOn = true; 8760 pParty->bTurnBasedModeOn = true;
8777 } 8761 }
8778 } 8762 }
8779 break; 8763 break;
8780 case INPUT_CastReady: 8764 case INPUT_CastReady:
8781 //__debugbreak();
8782 if (pCurrentScreen != SCREEN_GAME) 8765 if (pCurrentScreen != SCREEN_GAME)
8783 break; 8766 break;
8784 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3) 8767 if (pParty->bTurnBasedModeOn && pTurnEngine->field_4 == 3)
8785 //goto LABEL_118;
8786 { 8768 {
8787 pTurnEngine->field_18 |= 8u; 8769 pTurnEngine->field_18 |= 8u;
8788 break; 8770 break;
8789 } 8771 }
8790 if ( !uActiveCharacter ) 8772 if ( !uActiveCharacter )
8791 break; 8773 break;
8792 v7 = pPlayers[uActiveCharacter]; 8774 v8 = pPlayers[uActiveCharacter]->uQuickSpell;
8793 v8 = v7->uQuickSpell;
8794 if ( !v8 8775 if ( !v8
8795 || bUnderwater 8776 || bUnderwater
8796 || ((v9 = v7->pActiveSkills[(unsigned __int8)v8 / 11 + 12], !(HIBYTE(v9) & 1)) ? ((v9 & 0x80u) == 0 ? (!(v9 & 0x40) ? (v10 = *(&pSpellDatas[0].uNormalLevelMana + 10 * (unsigned __int8)v8)) : (v10 = *(&pSpellDatas[0].uExpertLevelMana + 10 * (unsigned __int8)v8))) : (v10 = *(&pSpellDatas[0].uMasterLevelMana + 10 * (unsigned __int8)v8))) : (v10 = *(&pSpellDatas[0].uMagisterLevelMana + 10 * (unsigned __int8)v8)), 8777 || ((v9 = pPlayers[uActiveCharacter]->pActiveSkills[(unsigned __int8)v8 / 11 + 12], !(HIBYTE(v9) & 1)) ?
8797 v10 > v7->sMana) ) 8778 ((v9 & 0x80u) == 0 ? (!(v9 & 0x40) ? (v10 = *(&pSpellDatas[0].uNormalLevelMana + 10 * (unsigned __int8)v8)) :
8779 (v10 = *(&pSpellDatas[0].uExpertLevelMana + 10 * (unsigned __int8)v8))) :
8780 (v10 = *(&pSpellDatas[0].uMasterLevelMana + 10 * (unsigned __int8)v8))) :
8781 (v10 = *(&pSpellDatas[0].uMagisterLevelMana + 10 * (unsigned __int8)v8)),
8782 v10 > pPlayers[uActiveCharacter]->sMana) )
8798 { 8783 {
8799 pActionQueue = pPartyActionQueue; 8784 pPartyActionQueue = pPartyActionQueue;
8800 LABEL_120:
8801 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); 8785 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0);
8802 break; 8786 break;
8803 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8804 {
8805 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack;
8806 //goto _send_message;
8807 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8808 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8809 ++pMessageQueue_50CBD0->uNumMessages;
8810 break;
8811 }*/
8812 } 8787 }
8813 else 8788 else
8814 { 8789 {
8815 pActionQueue = pPartyActionQueue; 8790 /*if ( dword_50C9E8 < 40 )
8816 if ( dword_50C9E8 < 40 )
8817 { 8791 {
8818 dword_50C9EC[3 * dword_50C9E8] = 25; 8792 dword_50C9EC[3 * dword_50C9E8] = 25;
8819 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; 8793 dword_50C9EC[3 * dword_50C9E8 + 1] = 0;
8820 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; 8794 dword_50C9EC[3 * dword_50C9E8 + 2] = 0;
8821 ++dword_50C9E8; 8795 ++dword_50C9E8;
8822 } 8796 }*/
8797 pMessageQueue_50CBD0->AddMessage(UIMSG_CastQuickSpell, 0, 0);
8823 } 8798 }
8824 break; 8799 break;
8825 case INPUT_Attack: 8800 case INPUT_Attack:
8826 //__debugbreak();
8827 if (pCurrentScreen != SCREEN_GAME) 8801 if (pCurrentScreen != SCREEN_GAME)
8828 break; 8802 break;
8829 if (!pParty->bTurnBasedModeOn || pTurnEngine->field_4 != 3) 8803 if (pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3)
8830 goto LABEL_120; 8804 {
8831 //LABEL_118: 8805 pTurnEngine->field_18 |= 8u;
8832 pTurnEngine->field_18 |= 8u; 8806 break;
8807 }
8808 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0);
8833 break; 8809 break;
8834 case INPUT_EventTrigger: 8810 case INPUT_EventTrigger:
8835 if (pCurrentScreen == SCREEN_GAME) 8811 if (pCurrentScreen == SCREEN_GAME)
8836 { 8812 {
8837 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
8838 break;
8839 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action;
8840 //goto _send_message;
8841 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8842 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8843 ++pMessageQueue_50CBD0->uNumMessages;
8844 break;*/
8845 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); 8813 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0);
8846 break; 8814 break;
8847 } 8815 }
8848 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) 8816 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE )
8849 { 8817 {
8850 v11 = pMessageQueue_50CBD0->uNumMessages;
8851 if ( pMessageQueue_50CBD0->uNumMessages ) 8818 if ( pMessageQueue_50CBD0->uNumMessages )
8852 { 8819 {
8853 v11 = 0;
8854 pMessageQueue_50CBD0->uNumMessages = 0; 8820 pMessageQueue_50CBD0->uNumMessages = 0;
8855 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) 8821 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
8856 { 8822 {
8857 v11 = 1;
8858 pMessageQueue_50CBD0->uNumMessages = 1; 8823 pMessageQueue_50CBD0->uNumMessages = 1;
8859 //LABEL_132: 8824 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
8860 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape;
8861 //_send_message:
8862 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 8825 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8863 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 8826 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8864 ++pMessageQueue_50CBD0->uNumMessages; 8827 ++pMessageQueue_50CBD0->uNumMessages;
8865 break; 8828 break;
8866 } 8829 }
8867 break; 8830 break;
8868 } 8831 }
8869 /*if ( (signed int)v11 < 40 )
8870 //goto LABEL_132;
8871 {
8872 pMessageQueue_50CBD0->pMessages[v11].eType = UIMSG_Escape;
8873 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8874 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8875 ++pMessageQueue_50CBD0->uNumMessages;
8876 break;
8877 }*/
8878 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); 8832 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
8879 } 8833 }
8880 break; 8834 break;
8881 case INPUT_CharCycle: 8835 case INPUT_CharCycle:
8882 //__debugbreak(); 8836 if ( pCurrentScreen == SCREEN_SPELL_BOOK )// || dword_50C9E8 >= 40 )
8883 if ( pCurrentScreen == SCREEN_SPELL_BOOK
8884 || dword_50C9E8 >= 40 )
8885 break; 8837 break;
8886 dword_50C9EC[3 * dword_50C9E8] = 176; 8838 /*dword_50C9EC[3 * dword_50C9E8] = 176;
8887 //goto LABEL_155;
8888 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; 8839 dword_50C9EC[3 * dword_50C9E8 + 1] = 0;
8889 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; 8840 dword_50C9EC[3 * dword_50C9E8 + 2] = 0;
8890 ++dword_50C9E8; 8841 ++dword_50C9E8;*/
8842 pMessageQueue_50CBD0->AddMessage(UIMSG_CycleCharacters, 0, 0);
8891 break; 8843 break;
8892 case INPUT_LookUp: 8844 case INPUT_LookUp:
8893 //__debugbreak();
8894 if ( pEventTimer->bPaused ) 8845 if ( pEventTimer->bPaused )
8895 break; 8846 break;
8896 partyAction = (PartyAction)7; 8847 partyAction = (PartyAction)7;
8897 //goto _add_action_and_continue_; 8848 pPartyActionQueue->Add(partyAction);
8898 v5 = pActionQueue;
8899 v5->Add(partyAction);
8900 break; 8849 break;
8901 case INPUT_CenterView: 8850 case INPUT_CenterView:
8902 //__debugbreak();
8903 if ( pEventTimer->bPaused ) 8851 if ( pEventTimer->bPaused )
8904 break; 8852 break;
8905 partyAction = (PartyAction)9; 8853 partyAction = (PartyAction)9;
8906 //goto _add_action_and_continue_; 8854 pPartyActionQueue->Add(partyAction);
8907 v5 = pActionQueue;
8908 v5->Add(partyAction);
8909 break; 8855 break;
8910 case INPUT_LookDown: 8856 case INPUT_LookDown:
8911 //__debugbreak();
8912 if ( pEventTimer->bPaused ) 8857 if ( pEventTimer->bPaused )
8913 break; 8858 break;
8914 partyAction = (PartyAction)8; 8859 partyAction = (PartyAction)8;
8915 //goto _add_action_and_continue_; 8860 pPartyActionQueue->Add(partyAction);
8916 v5 = pActionQueue;
8917 v5->Add(partyAction);
8918 break; 8861 break;
8919 case INPUT_FlyUp: 8862 case INPUT_FlyUp:
8920 //__debugbreak(); 8863 if ( pCurrentScreen || pEventTimer->bPaused )
8921 if ( pCurrentScreen
8922 || pEventTimer->bPaused )
8923 break; 8864 break;
8924 partyAction = (PartyAction)13; 8865 partyAction = (PartyAction)13;
8925 //goto _add_action_and_continue_; 8866 pPartyActionQueue->Add(partyAction);
8926 v5 = pActionQueue;
8927 v5->Add(partyAction);
8928 break; 8867 break;
8929 case INPUT_Land: 8868 case INPUT_Land:
8930 //__debugbreak(); 8869 if ( pCurrentScreen || pEventTimer->bPaused )
8931 if ( pCurrentScreen
8932 || pEventTimer->bPaused )
8933 break; 8870 break;
8934 partyAction = (PartyAction)15; 8871 partyAction = (PartyAction)15;
8935 //goto _add_action_and_continue_; 8872 pPartyActionQueue->Add(partyAction);
8936 v5 = pActionQueue;
8937 v5->Add(partyAction);
8938 break; 8873 break;
8939 case INPUT_FlyDown: 8874 case INPUT_FlyDown:
8940 //__debugbreak();
8941 if ( !pCurrentScreen 8875 if ( !pCurrentScreen
8942 && !pEventTimer->bPaused ) 8876 && !pEventTimer->bPaused )
8943 { 8877 {
8944 partyAction = (PartyAction)14; 8878 partyAction = (PartyAction)14;
8945 //_add_action_and_continue_: 8879 pPartyActionQueue->Add(partyAction);
8946 v5 = pActionQueue;
8947 //_add_action_and_continue:
8948 v5->Add(partyAction);
8949 } 8880 }
8950 break; 8881 break;
8951 case INPUT_ZoomIn: 8882 case INPUT_ZoomIn:
8952 //__debugbreak(); 8883 /*if ( dword_50C9E8 >= 40 )
8953 if ( dword_50C9E8 >= 40 )
8954 break; 8884 break;
8955 dword_50C9EC[3 * dword_50C9E8] = 367; 8885 dword_50C9EC[3 * dword_50C9E8] = 367;
8956 //goto LABEL_155;
8957 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; 8886 dword_50C9EC[3 * dword_50C9E8 + 1] = 0;
8958 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; 8887 dword_50C9EC[3 * dword_50C9E8 + 2] = 0;
8959 ++dword_50C9E8; 8888 ++dword_50C9E8;*/
8889 pMessageQueue_50CBD0->AddMessage(UIMSG_ClickZoomOutBtn, 0, 0);
8960 break; 8890 break;
8961 case INPUT_ZoomOut: 8891 case INPUT_ZoomOut:
8962 //__debugbreak(); 8892 /*if ( dword_50C9E8 < 40 )
8963 if ( dword_50C9E8 < 40 )
8964 { 8893 {
8965 dword_50C9EC[3 * dword_50C9E8] = 368; 8894 dword_50C9EC[3 * dword_50C9E8] = 368;
8966 //LABEL_155:
8967 dword_50C9EC[3 * dword_50C9E8 + 1] = 0; 8895 dword_50C9EC[3 * dword_50C9E8 + 1] = 0;
8968 dword_50C9EC[3 * dword_50C9E8 + 2] = 0; 8896 dword_50C9EC[3 * dword_50C9E8 + 2] = 0;
8969 ++dword_50C9E8; 8897 ++dword_50C9E8;
8970 } 8898 }*/
8899 pMessageQueue_50CBD0->AddMessage(UIMSG_ClickZoomInBtn, 0, 0);
8971 break; 8900 break;
8972 case INPUT_AlwaysRun: 8901 case INPUT_AlwaysRun:
8973 bAlwaysRun = bAlwaysRun == 0; 8902 bAlwaysRun = bAlwaysRun == 0;
8974 break; 8903 break;
8975 default: 8904 default:
8976 //__debugbreak();
8977 break; 8905 break;
8978 } 8906 }
8979 } 8907 }
8980 inputAction = (InputAction)((int)inputAction + 1);
8981 if ( (signed int)inputAction >= 30 )
8982 goto LABEL_176;
8983 } 8908 }
8984 } 8909 }
8985 v12 = 0;
8986 do
8987 {
8988 v22 = pKeyActionMap->pVirtualKeyCodesMapping[v12];
8989 v13 = pGame->pKeyboardInstance;
8990 if ( pKeyActionMap->pToggleTypes[v12] )
8991 v14 = v13->WasKeyPressed(v22);
8992 else
8993 v14 = v13->IsKeyBeingHeld(v22);
8994 if ( v14 && v12 == 9 )
8995 {
8996 if ( !pCurrentScreen )
8997 {
8998 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
8999 goto LABEL_175;
9000 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Game_Action;
9001 //goto LABEL_174;
9002 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
9003 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
9004 ++pMessageQueue_50CBD0->uNumMessages;*/
9005 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0);
9006 goto LABEL_175;
9007 }
9008 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE
9009 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
9010 {
9011 v15 = pMessageQueue_50CBD0->uNumMessages;
9012 if ( pMessageQueue_50CBD0->uNumMessages )
9013 {
9014 v15 = 0;
9015 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
9016 {
9017 v15 = 1;
9018 pMessageQueue_50CBD0->uNumMessages = 0;
9019 //goto LABEL_173;
9020 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape;
9021 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
9022 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
9023 ++pMessageQueue_50CBD0->uNumMessages;
9024 goto LABEL_175;
9025 }
9026 pMessageQueue_50CBD0->uNumMessages = 0;
9027 }
9028 /*if ( (signed int)v15 >= 40 )
9029 goto LABEL_175;
9030 //LABEL_173:
9031 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape;
9032 //LABEL_174:
9033 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
9034 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
9035 ++pMessageQueue_50CBD0->uNumMessages;*/
9036 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
9037 goto LABEL_175;
9038 }
9039 }
9040 LABEL_175:
9041 ++v12;
9042 }
9043 while ( v12 < 30 );
9044 LABEL_176:
9045 if (pGame->pKeyboardInstance->bUsingAsynKeyboard) 8910 if (pGame->pKeyboardInstance->bUsingAsynKeyboard)
9046 { 8911 {
9047 AsyncKeyboard::LeaveCriticalSection(); 8912 AsyncKeyboard::LeaveCriticalSection();
9048 v16 = pAsyncKeyboard; 8913 //v16 = pAsyncKeyboard;
9049 AsyncKeyboard::EnterCriticalSection(); 8914 AsyncKeyboard::EnterCriticalSection();
9050 memset((char *)v16 + 521, 0, 0x100u); 8915 memset((char *)pAsyncKeyboard + 521, 0, 0x100u);
9051 AsyncKeyboard::LeaveCriticalSection(); 8916 AsyncKeyboard::LeaveCriticalSection();
9052 } 8917 }
9053 } 8918 }