comparison mm7_5.cpp @ 783:b27dd658ea77

Taveling by foot fixed.
author Nomad
date Sun, 24 Mar 2013 21:14:28 +0200
parents a464d28566a6
children b3e08a496778
comparison
equal deleted inserted replaced
778:64cef5a0782a 783:b27dd658ea77
277 POINT v208; // [sp+70h] [bp-58Ch]@397 277 POINT v208; // [sp+70h] [bp-58Ch]@397
278 POINT v209; // [sp+78h] [bp-584h]@777 278 POINT v209; // [sp+78h] [bp-584h]@777
279 POINT v210; // [sp+80h] [bp-57Ch]@397 279 POINT v210; // [sp+80h] [bp-57Ch]@397
280 POINT v211; // [sp+88h] [bp-574h]@704 280 POINT v211; // [sp+88h] [bp-574h]@704
281 __int64 v212; // [sp+90h] [bp-56Ch]@467 281 __int64 v212; // [sp+90h] [bp-56Ch]@467
282 char v213; // [sp+98h] [bp-564h]@385 282 int v213; // [sp+98h] [bp-564h]@385
283 char pLevelName; // [sp+9Ch] [bp-560h]@380 283 char pLevelName[32]; // [sp+9Ch] [bp-560h]@380
284 char pOut; // [sp+BCh] [bp-540h]@370 284 char pOut[32]; // [sp+BCh] [bp-540h]@370
285 FrameTableTxtLine v216; // [sp+DCh] [bp-520h]@524 285 FrameTableTxtLine v216; // [sp+DCh] [bp-520h]@524
286 int v217[9]; // [sp+158h] [bp-4A4h]@652 286 int v217[9]; // [sp+158h] [bp-4A4h]@652
287 FrameTableTxtLine v218; // [sp+17Ch] [bp-480h]@524 287 FrameTableTxtLine v218; // [sp+17Ch] [bp-480h]@524
288 char a1[64]; // [sp+1F8h] [bp-404h]@467 288 char a1[64]; // [sp+1F8h] [bp-404h]@467
289 char Str2[128]; // [sp+238h] [bp-3C4h]@527 289 char Str2[128]; // [sp+238h] [bp-3C4h]@527
1071 else 1071 else
1072 { 1072 {
1073 pGUIWindow_Settings->Release(); 1073 pGUIWindow_Settings->Release();
1074 pGUIWindow_Settings = 0; 1074 pGUIWindow_Settings = 0;
1075 pMouse->SetCursorBitmap("MICON1"); 1075 pMouse->SetCursorBitmap("MICON1");
1076 GameUI_StatusBar_TimedStringTimeLeft = 0; 1076 GameUI_Footer_TimeLeft = 0;
1077 unk_50C9A0 = 0; 1077 unk_50C9A0 = 0;
1078 back_to_game(); 1078 back_to_game();
1079 } 1079 }
1080 } 1080 }
1081 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1081 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1103 else 1103 else
1104 { 1104 {
1105 pGUIWindow_Settings->Release(); 1105 pGUIWindow_Settings->Release();
1106 pGUIWindow_Settings = 0; 1106 pGUIWindow_Settings = 0;
1107 pMouse->SetCursorBitmap("MICON1"); 1107 pMouse->SetCursorBitmap("MICON1");
1108 GameUI_StatusBar_TimedStringTimeLeft = 0; 1108 GameUI_Footer_TimeLeft = 0;
1109 unk_50C9A0 = 0; 1109 unk_50C9A0 = 0;
1110 back_to_game(); 1110 back_to_game();
1111 } 1111 }
1112 } 1112 }
1113 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1113 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1294 else 1294 else
1295 { 1295 {
1296 pGUIWindow_Settings->Release(); 1296 pGUIWindow_Settings->Release();
1297 pGUIWindow_Settings = 0; 1297 pGUIWindow_Settings = 0;
1298 pMouse->SetCursorBitmap("MICON1"); 1298 pMouse->SetCursorBitmap("MICON1");
1299 GameUI_StatusBar_TimedStringTimeLeft = 0; 1299 GameUI_Footer_TimeLeft = 0;
1300 unk_50C9A0 = 0; 1300 unk_50C9A0 = 0;
1301 back_to_game(); 1301 back_to_game();
1302 } 1302 }
1303 } 1303 }
1304 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1304 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1343 else 1343 else
1344 { 1344 {
1345 pGUIWindow_Settings->Release(); 1345 pGUIWindow_Settings->Release();
1346 pGUIWindow_Settings = 0; 1346 pGUIWindow_Settings = 0;
1347 pMouse->SetCursorBitmap("MICON1"); 1347 pMouse->SetCursorBitmap("MICON1");
1348 GameUI_StatusBar_TimedStringTimeLeft = 0; 1348 GameUI_Footer_TimeLeft = 0;
1349 unk_50C9A0 = 0; 1349 unk_50C9A0 = 0;
1350 back_to_game(); 1350 back_to_game();
1351 } 1351 }
1352 } 1352 }
1353 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1353 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1383 viewparams->bRedrawGameUI = v0; 1383 viewparams->bRedrawGameUI = v0;
1384 dword_5B65CC = 0; 1384 dword_5B65CC = 0;
1385 } 1385 }
1386 goto LABEL_317; 1386 goto LABEL_317;
1387 case SCREEN_BRANCHLESS_NPC_DIALOG: 1387 case SCREEN_BRANCHLESS_NPC_DIALOG:
1388 memset(GameUI_StatusBar_TimedString, 0, 0xC8u); 1388 memset(GameUI_Footer_TimedString, 0, 0xC8u);
1389 sub_4452BB(); 1389 sub_4452BB();
1390 goto LABEL_317; 1390 goto LABEL_317;
1391 case SCREEN_CHANGE_LOCATION: 1391 case SCREEN_CHANGE_LOCATION:
1392 if ( pParty->vPosition.x < -22528 ) 1392 if ( pParty->vPosition.x < -22528 )
1393 pParty->vPosition.x = -22528; 1393 pParty->vPosition.x = -22528;
1413 else 1413 else
1414 { 1414 {
1415 pGUIWindow_Settings->Release(); 1415 pGUIWindow_Settings->Release();
1416 pGUIWindow_Settings = 0; 1416 pGUIWindow_Settings = 0;
1417 pMouse->SetCursorBitmap("MICON1"); 1417 pMouse->SetCursorBitmap("MICON1");
1418 GameUI_StatusBar_TimedStringTimeLeft = 0; 1418 GameUI_Footer_TimeLeft = 0;
1419 unk_50C9A0 = 0; 1419 unk_50C9A0 = 0;
1420 back_to_game(); 1420 back_to_game();
1421 } 1421 }
1422 } 1422 }
1423 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1423 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1441 else 1441 else
1442 { 1442 {
1443 pGUIWindow_Settings->Release(); 1443 pGUIWindow_Settings->Release();
1444 pGUIWindow_Settings = 0; 1444 pGUIWindow_Settings = 0;
1445 pMouse->SetCursorBitmap("MICON1"); 1445 pMouse->SetCursorBitmap("MICON1");
1446 GameUI_StatusBar_TimedStringTimeLeft = 0; 1446 GameUI_Footer_TimeLeft = 0;
1447 unk_50C9A0 = 0; 1447 unk_50C9A0 = 0;
1448 back_to_game(); 1448 back_to_game();
1449 } 1449 }
1450 } 1450 }
1451 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1451 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1475 else 1475 else
1476 { 1476 {
1477 pGUIWindow_Settings->Release(); 1477 pGUIWindow_Settings->Release();
1478 pGUIWindow_Settings = 0; 1478 pGUIWindow_Settings = 0;
1479 pMouse->SetCursorBitmap("MICON1"); 1479 pMouse->SetCursorBitmap("MICON1");
1480 GameUI_StatusBar_TimedStringTimeLeft = 0; 1480 GameUI_Footer_TimeLeft = 0;
1481 unk_50C9A0 = 0; 1481 unk_50C9A0 = 0;
1482 back_to_game(); 1482 back_to_game();
1483 } 1483 }
1484 } 1484 }
1485 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1485 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1541 continue; 1541 continue;
1542 } 1542 }
1543 pWindow3->Release(); 1543 pWindow3->Release();
1544 pGUIWindow_Settings = 0; 1544 pGUIWindow_Settings = 0;
1545 pMouse->SetCursorBitmap("MICON1"); 1545 pMouse->SetCursorBitmap("MICON1");
1546 GameUI_StatusBar_TimedStringTimeLeft = 0; 1546 GameUI_Footer_TimeLeft = 0;
1547 unk_50C9A0 = 0; 1547 unk_50C9A0 = 0;
1548 back_to_game(); 1548 back_to_game();
1549 continue; 1549 continue;
1550 } 1550 }
1551 sub_41426F(); 1551 sub_41426F();
1621 if ( *dword_591164_teleport_map_name != 48 ) 1621 if ( *dword_591164_teleport_map_name != 48 )
1622 { 1622 {
1623 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2; 1623 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2;
1624 dword_5B65C0 = _5B65A8_npcdata_uflags_or_other | _5B65AC_npcdata_fame_or_other | _5B65B0_npcdata_rep_or_other | _5B65B4_npcdata_loword_house_or_other | _5B65B8_npcdata_hiword_house_or_other | v38; 1624 dword_5B65C0 = _5B65A8_npcdata_uflags_or_other | _5B65AC_npcdata_fame_or_other | _5B65B0_npcdata_rep_or_other | _5B65B4_npcdata_loword_house_or_other | _5B65B8_npcdata_hiword_house_or_other | v38;
1625 OnMapLeave(); 1625 OnMapLeave();
1626 sub_44987B(dword_591164_teleport_map_name, 0); 1626 sub_44987B(dword_591164_teleport_map_name, MapStartPoint_Party);
1627 } 1627 }
1628 } 1628 }
1629 else 1629 else
1630 { 1630 {
1631 start_event_seq_number = dword_5C341C; 1631 start_event_seq_number = dword_5C341C;
1643 goto LABEL_422; 1643 goto LABEL_422;
1644 case UIMSG_CycleCharacters: 1644 case UIMSG_CycleCharacters:
1645 v39 = GetAsyncKeyState(VK_SHIFT); 1645 v39 = GetAsyncKeyState(VK_SHIFT);
1646 v40 = CycleCharacter(v39); 1646 v40 = CycleCharacter(v39);
1647 goto LABEL_421; 1647 goto LABEL_421;
1648 case UIMSG_5A: 1648 case UIMSG_OnTravelByFoot:
1649 if ( pMessageQueue_50CBD0->uNumMessages ) 1649 if ( pMessageQueue_50CBD0->uNumMessages )
1650 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 1650 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
1651 dword_50CDC8 = v0; 1651 dword_50CDC8 = v0;
1652 sub_42FBDD(); 1652 sub_42FBDD();
1653 pNPCData4 = (NPCData *)GetTravelTime(); 1653 pNPCData4 = (NPCData *)GetTravelTime();
1654 strcpy(pOutdoor->pLevelFilename, pCurrentMapName); 1654 strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
1655 if ( bUnderwater != 1 && pParty->bFlying 1655 if ( bUnderwater != 1 && pParty->bFlying
1656 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, &pOut, 20) != v0 ) 1656 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != v0 )
1657 { 1657 {
1658 viewparams->bRedrawGameUI = v0; 1658 viewparams->bRedrawGameUI = v0;
1659 LABEL_387: 1659 LABEL_387:
1660 CloseWindowBackground(); 1660 CloseWindowBackground();
1661 if ( pParty->vPosition.x < -22528 ) 1661 if ( pParty->vPosition.x < -22528 )
1709 while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings ); 1709 while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings );
1710 ++pParty->days_played_without_rest; 1710 ++pParty->days_played_without_rest;
1711 } 1711 }
1712 pPaletteManager->ResetNonLocked(); 1712 pPaletteManager->ResetNonLocked();
1713 pSpriteFrameTable->ResetSomeSpriteFlags(); 1713 pSpriteFrameTable->ResetSomeSpriteFlags();
1714 strcpy(pCurrentMapName, &pOut); 1714 strcpy(pCurrentMapName, pOut);
1715 strcpy(&pLevelName, pCurrentMapName); 1715 strcpy(pLevelName, pCurrentMapName);
1716 v41 = strtok(&pLevelName, "."); 1716 v41 = strtok(pLevelName, ".");
1717 strcpy(&pLevelName, v41); 1717 strcpy(pLevelName, v41);
1718 Level_LoadEvtAndStr(&pLevelName); 1718 Level_LoadEvtAndStr(pLevelName);
1719 pDecalBuilder->Reset( 0); 1719 pDecalBuilder->Reset(0);
1720 LoadLevel_InitializeLevelEvt(); 1720 LoadLevel_InitializeLevelEvt();
1721 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName); 1721 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName);
1722 bUnderwater = 0; 1722 bUnderwater = 0;
1723 bNoNPCHiring = 0; 1723 bNoNPCHiring = 0;
1724 pGame->uFlags2 &= 0xFFFFFFF7u; 1724 pGame->uFlags2 &= 0xFFFFFFF7u;
1734 pAudioPlayer->SetMapEAX(); 1734 pAudioPlayer->SetMapEAX();
1735 bDialogueUI_InitializeActor_NPC_ID = 0; 1735 bDialogueUI_InitializeActor_NPC_ID = 0;
1736 OnMapLoad(); 1736 OnMapLoad();
1737 pOutdoor->SetFog(); 1737 pOutdoor->SetFog();
1738 TeleportToStartingPoint(uLevel_StartingPointType); 1738 TeleportToStartingPoint(uLevel_StartingPointType);
1739 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, (int *)&v213, 0); 1739 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0);
1740 pParty->uFallStartY = pParty->vPosition.z; 1740 pParty->uFallStartY = pParty->vPosition.z;
1741 sub_461103(); 1741 sub_461103();
1742 pEventTimer->Resume(); 1742 pEventTimer->Resume();
1743 viewparams->bRedrawGameUI = 1; 1743 viewparams->bRedrawGameUI = 1;
1744 pCurrentScreen = SCREEN_GAME; 1744 pCurrentScreen = SCREEN_GAME;
1776 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); 1776 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300);
1777 pWindow3 = pGUIWindow_Settings; 1777 pWindow3 = pGUIWindow_Settings;
1778 pWindow3->Release(); 1778 pWindow3->Release();
1779 pGUIWindow_Settings = 0; 1779 pGUIWindow_Settings = 0;
1780 pMouse->SetCursorBitmap("MICON1"); 1780 pMouse->SetCursorBitmap("MICON1");
1781 GameUI_StatusBar_TimedStringTimeLeft = 0; 1781 GameUI_Footer_TimeLeft = 0;
1782 unk_50C9A0 = 0; 1782 unk_50C9A0 = 0;
1783 back_to_game(); 1783 back_to_game();
1784 continue; 1784 continue;
1785 } 1785 }
1786 if ( v45 == 2 ) 1786 if ( v45 == 2 )
1797 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); 1797 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300);
1798 pWindow3 = pGUIWindow_Settings; 1798 pWindow3 = pGUIWindow_Settings;
1799 pWindow3->Release(); 1799 pWindow3->Release();
1800 pGUIWindow_Settings = 0; 1800 pGUIWindow_Settings = 0;
1801 pMouse->SetCursorBitmap("MICON1"); 1801 pMouse->SetCursorBitmap("MICON1");
1802 GameUI_StatusBar_TimedStringTimeLeft = 0; 1802 GameUI_Footer_TimeLeft = 0;
1803 unk_50C9A0 = 0; 1803 unk_50C9A0 = 0;
1804 back_to_game(); 1804 back_to_game();
1805 continue; 1805 continue;
1806 } 1806 }
1807 if ( v45 == 5 ) 1807 if ( v45 == 5 )
1826 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); 1826 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300);
1827 pWindow3 = pGUIWindow_Settings; 1827 pWindow3 = pGUIWindow_Settings;
1828 pWindow3->Release(); 1828 pWindow3->Release();
1829 pGUIWindow_Settings = 0; 1829 pGUIWindow_Settings = 0;
1830 pMouse->SetCursorBitmap("MICON1"); 1830 pMouse->SetCursorBitmap("MICON1");
1831 GameUI_StatusBar_TimedStringTimeLeft = 0; 1831 GameUI_Footer_TimeLeft = 0;
1832 unk_50C9A0 = 0; 1832 unk_50C9A0 = 0;
1833 back_to_game(); 1833 back_to_game();
1834 continue; 1834 continue;
1835 } 1835 }
1836 pBLVFace = &pIndoor->pFaces[v46]; 1836 pBLVFace = &pIndoor->pFaces[v46];
1850 pWindow3 = pGUIWindow_Settings; 1850 pWindow3 = pGUIWindow_Settings;
1851 //LABEL_333: 1851 //LABEL_333:
1852 pWindow3->Release(); 1852 pWindow3->Release();
1853 pGUIWindow_Settings = 0; 1853 pGUIWindow_Settings = 0;
1854 pMouse->SetCursorBitmap("MICON1"); 1854 pMouse->SetCursorBitmap("MICON1");
1855 GameUI_StatusBar_TimedStringTimeLeft = 0; 1855 GameUI_Footer_TimeLeft = 0;
1856 unk_50C9A0 = 0; 1856 unk_50C9A0 = 0;
1857 back_to_game(); 1857 back_to_game();
1858 continue; 1858 continue;
1859 case UIMSG_45: 1859 case UIMSG_45:
1860 case UIMSG_8D: 1860 case UIMSG_8D:
1890 pParty->pPlayers[*((short *)v52 + 1)].SetRecoveryTime(300); 1890 pParty->pPlayers[*((short *)v52 + 1)].SetRecoveryTime(300);
1891 pGUIWindow_Settings->Release(); 1891 pGUIWindow_Settings->Release();
1892 pGUIWindow_Settings = 0; 1892 pGUIWindow_Settings = 0;
1893 pEventTimer->Resume(); 1893 pEventTimer->Resume();
1894 pMouse->SetCursorBitmap("MICON1"); 1894 pMouse->SetCursorBitmap("MICON1");
1895 GameUI_StatusBar_TimedStringTimeLeft = 0; 1895 GameUI_Footer_TimeLeft = 0;
1896 unk_50C9A0 = 0; 1896 unk_50C9A0 = 0;
1897 } 1897 }
1898 } 1898 }
1899 continue; 1899 continue;
1900 case UIMSG_BF: 1900 case UIMSG_BF:
2440 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); 2440 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300);
2441 pWindow3 = pGUIWindow_Settings; 2441 pWindow3 = pGUIWindow_Settings;
2442 pWindow3->Release(); 2442 pWindow3->Release();
2443 pGUIWindow_Settings = 0; 2443 pGUIWindow_Settings = 0;
2444 pMouse->SetCursorBitmap("MICON1"); 2444 pMouse->SetCursorBitmap("MICON1");
2445 GameUI_StatusBar_TimedStringTimeLeft = 0; 2445 GameUI_Footer_TimeLeft = 0;
2446 unk_50C9A0 = 0; 2446 unk_50C9A0 = 0;
2447 back_to_game(); 2447 back_to_game();
2448 continue; 2448 continue;
2449 case UIMSG_1C: 2449 case UIMSG_1C:
2450 if ( !uActiveCharacter || pCurrentScreen ) 2450 if ( !uActiveCharacter || pCurrentScreen )
3908 } 3908 }
3909 if ( pUIMessageType == UIMSG_PlayerCreationClickOK ) 3909 if ( pUIMessageType == UIMSG_PlayerCreationClickOK )
3910 { 3910 {
3911 GUIWindow::Create(580, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0); 3911 GUIWindow::Create(580, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0);
3912 if ( PlayerCreation_ComputeAttributeBonus() || !PlayerCreation_Chose4Skills() ) 3912 if ( PlayerCreation_ComputeAttributeBonus() || !PlayerCreation_Chose4Skills() )
3913 GameUI_StatusBar_TimedStringTimeLeft = GetTickCount() + 4000; 3913 GameUI_Footer_TimeLeft = GetTickCount() + 4000;
3914 else 3914 else
3915 uGameState = 6; 3915 uGameState = 6;
3916 continue; 3916 continue;
3917 } 3917 }
3918 if ( pUIMessageType == UIMSG_PlayerCreationClickReset ) 3918 if ( pUIMessageType == UIMSG_PlayerCreationClickReset )
4500 return result; 4500 return result;
4501 } 4501 }
4502 4502
4503 4503
4504 //----- (00438F8F) -------------------------------------------------------- 4504 //----- (00438F8F) --------------------------------------------------------
4505 void __cdecl _438F8F_area_of_effect__damage_evaluate() 4505 void __cdecl area_of_effect__damage_evaluate()
4506 { 4506 {
4507 int v0; // edx@1 4507 int v0; // edx@1
4508 char *v1; // esi@2 4508 char *v1; // esi@2
4509 int v2; // ecx@3 4509 int v2; // ecx@3
4510 signed int v3; // eax@3 4510 signed int v3; // eax@3