comparison mm7_2.cpp @ 783:b27dd658ea77

Taveling by foot fixed.
author Nomad
date Sun, 24 Mar 2013 21:14:28 +0200
parents 7994986603d5
children b3e08a496778
comparison
equal deleted inserted replaced
778:64cef5a0782a 783:b27dd658ea77
6593 6593
6594 6594
6595 6595
6596 6596
6597 //----- (0046086A) -------------------------------------------------------- 6597 //----- (0046086A) --------------------------------------------------------
6598 bool Autosave() 6598 void Autosave()
6599 { 6599 {
6600 int flag; // esi@3
6601 FILE *v3; // eax@7 6600 FILE *v3; // eax@7
6602 LOD::FileHeader this_; // [sp+Ch] [bp-16Ch]@3 6601 LOD::FileHeader this_; // [sp+Ch] [bp-16Ch]@3
6603 LOD::Directory pDir; // [sp+10Ch] [bp-6Ch]@4 6602 LOD::Directory pDir; // [sp+10Ch] [bp-6Ch]@4
6604 LOD::Directory v7; // [sp+12Ch] [bp-4Ch]@9 6603 LOD::Directory v7; // [sp+12Ch] [bp-4Ch]@9
6605 LOD::Directory a3; // [sp+14Ch] [bp-2Ch]@3 6604 LOD::Directory a3; // [sp+14Ch] [bp-2Ch]@3
6606 void *pSave; // [sp+170h] [bp-8h]@3 6605 void *pSave; // [sp+170h] [bp-8h]@3
6607 6606
6608 if ( pVideoPlayer->AnyMovieLoaded() ) 6607 if ( pVideoPlayer->AnyMovieLoaded() )
6609 pVideoPlayer->Unload(); 6608 pVideoPlayer->Unload();
6610 flag = 0;
6611 pSave = pAllocator->AllocNamedChunk(0, 0xF4240, 0); 6609 pSave = pAllocator->AllocNamedChunk(0, 0xF4240, 0);
6612 pNew_LOD->CloseWriteFile(); 6610 pNew_LOD->CloseWriteFile();
6613 remove("data\\new.lod"); 6611 remove("data\\new.lod");
6614 this_.Reset(); 6612 this_.Reset();
6615 strcpy(this_.LodVersion, "MMVII"); 6613 strcpy(this_.LodVersion, "MMVII");
6646 pParty->uFallStartY = 0; 6644 pParty->uFallStartY = 0;
6647 pParty->sPrevRotationX = 0; 6645 pParty->sPrevRotationX = 0;
6648 pParty->sRotationX = 0; 6646 pParty->sRotationX = 0;
6649 pParty->vPrevPosition.z = 1816; 6647 pParty->vPrevPosition.z = 1816;
6650 pParty->vPosition.y = 1816; 6648 pParty->vPosition.y = 1816;
6651 flag = 1;
6652 pParty->sPrevRotationY = 512; 6649 pParty->sPrevRotationY = 512;
6653 pParty->sRotationY = 512; 6650 pParty->sRotationY = 512;
6654 SaveGame(1, (__int16 *)1); 6651 SaveGame(1, (__int16 *)1);
6655 } 6652 }
6656 pAllocator->FreeChunk(pSave); 6653 pAllocator->FreeChunk(pSave);
6657 return flag;
6658 } 6654 }
6659 6655
6660 6656
6661 //----- (004610AA) -------------------------------------------------------- 6657 //----- (004610AA) --------------------------------------------------------
6662 void __fastcall PrepareToLoadODM(unsigned int bLoading, OutdoorCamera *a2) 6658 void __fastcall PrepareToLoadODM(unsigned int bLoading, OutdoorCamera *a2)
6842 pIndoorCamera->pos.x = 0; 6838 pIndoorCamera->pos.x = 0;
6843 pIndoorCamera->pos.z = 100; 6839 pIndoorCamera->pos.z = 100;
6844 pIndoorCamera->sRotationY = 0; 6840 pIndoorCamera->sRotationY = 0;
6845 pIndoorCamera->sRotationX = 0; 6841 pIndoorCamera->sRotationX = 0;
6846 viewparams->bRedrawGameUI = 1; 6842 viewparams->bRedrawGameUI = 1;
6847 uLevel_StartingPointType = 0; 6843 uLevel_StartingPointType = MapStartPoint_Party;
6848 pSprites_LOD->_461397(); 6844 pSprites_LOD->_461397();
6849 pPaletteManager->LockTestAll(); 6845 pPaletteManager->LockTestAll();
6850 if ( pParty->pPickedItem.uItemID != 0 ) 6846 if ( pParty->pPickedItem.uItemID != 0 )
6851 pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID); 6847 pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID);
6852 } 6848 }
9179 if (GetCurrentMenuID() == MENU_NEWGAME) 9175 if (GetCurrentMenuID() == MENU_NEWGAME)
9180 { 9176 {
9181 if ( pAudioPlayer->hAILRedbook ) 9177 if ( pAudioPlayer->hAILRedbook )
9182 AIL_redbook_stop(pAudioPlayer->hAILRedbook); 9178 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
9183 pParty->Reset(); 9179 pParty->Reset();
9184 for (uint k = 0; k < 50; ++k) 9180 pOtherOverlayList->Reset();
9185 pOtherOverlayList->pOverlays[k].Reset(); 9181
9186 strcpy(pCurrentMapName, pStartingMapName); 9182 strcpy(pCurrentMapName, pStartingMapName);
9187 pParty->CreateDefaultParty(0); 9183 pParty->CreateDefaultParty(0);
9188 PlayerCreationUI_Initialize(); 9184 PlayerCreationUI_Initialize();
9189 if ( PlayerCreationUI_Loop() ) 9185 if ( PlayerCreationUI_Loop() )
9190 { 9186 {
11551 LOBYTE(v0) = v0 | 2; 11547 LOBYTE(v0) = v0 | 2;
11552 return (unsigned int)v0 >> 1; 11548 return (unsigned int)v0 >> 1;
11553 } 11549 }
11554 11550
11555 //----- (0046BDC0) -------------------------------------------------------- 11551 //----- (0046BDC0) --------------------------------------------------------
11556 void __cdecl sub_46BDC0_UpdateUserInput_and_MapSpecificStuff() 11552 void __cdecl UpdateUserInput_and_MapSpecificStuff()
11557 { 11553 {
11558 if ( dword_6BE364_game_settings_1 & 0x80 ) 11554 if ( dword_6BE364_game_settings_1 & 0x80 )
11559 { 11555 {
11560 LOBYTE(dword_6BE364_game_settings_1) = dword_6BE364_game_settings_1 & 0x7F; 11556 LOBYTE(dword_6BE364_game_settings_1) = dword_6BE364_game_settings_1 & 0x7F;
11561 } 11557 }
11564 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) 11560 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
11565 BLV_UpdateUserInputAndOther(); 11561 BLV_UpdateUserInputAndOther();
11566 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) 11562 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
11567 ODM_UpdateUserInputAndOther(); 11563 ODM_UpdateUserInputAndOther();
11568 11564
11569 _438F8F_area_of_effect__damage_evaluate(); 11565 area_of_effect__damage_evaluate();
11570 } 11566 }
11571 } 11567 }
11572 11568
11573 11569
11574 11570
11577 { 11573 {
11578 UpdateObjects(); 11574 UpdateObjects();
11579 BLV_ProcessPartyActions(); 11575 BLV_ProcessPartyActions();
11580 UpdateActors_BLV(); 11576 UpdateActors_BLV();
11581 BLV_UpdateDoors(); 11577 BLV_UpdateDoors();
11582 _46CC4B_check_event_triggers(); 11578 check_event_triggers();
11583 } 11579 }
11584 11580
11585 //----- (0046BE0A) -------------------------------------------------------- 11581 //----- (0046BE0A) --------------------------------------------------------
11586 void __cdecl ODM_UpdateUserInputAndOther() 11582 void __cdecl ODM_UpdateUserInputAndOther()
11587 { 11583 {
11588 bool v0; // eax@5 11584 bool v0; // eax@5
11589 int pOut; // [sp+8h] [bp-20h]@5 11585 char pOut[32]; // [sp+8h] [bp-20h]@5
11590 11586
11591 UpdateObjects(); 11587 UpdateObjects();
11592 ODM_ProcessPartyActions(); 11588 ODM_ProcessPartyActions();
11593 if ( pParty->vPosition.x < -22528 11589 if ( pParty->vPosition.x < -22528
11594 || pParty->vPosition.x > 22528 11590 || pParty->vPosition.x > 22528
11595 || pParty->vPosition.y < -22528 11591 || pParty->vPosition.y < -22528
11596 || pParty->vPosition.y > 22528 ) 11592 || pParty->vPosition.y > 22528 )
11597 { 11593 {
11598 strcpy(pOutdoor->pLevelFilename, pCurrentMapName); 11594 strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
11599 v0 = pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, (char *)&pOut, 32); 11595 v0 = pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 32);
11600 if ( !bUnderwater && (pParty->uFlags & (PARTY_FLAGS_1_STANDING_ON_WATER | PARTY_FLAGS_1_FALLING | 0x04) || pParty->uFlags & 0x0200 || pParty->bFlying) || !v0 ) 11596 if ( !bUnderwater && (pParty->uFlags & (PARTY_FLAGS_1_STANDING_ON_WATER | PARTY_FLAGS_1_FALLING | 0x04) || pParty->uFlags & 0x0200 || pParty->bFlying) || !v0 )
11601 { 11597 {
11602 if ( pParty->vPosition.x < -22528 ) 11598 if ( pParty->vPosition.x < -22528 )
11603 pParty->vPosition.x = -22528; 11599 pParty->vPosition.x = -22528;
11604 if ( pParty->vPosition.x > 22528 ) 11600 if ( pParty->vPosition.x > 22528 )
11613 pAudioPlayer->StopChannels(-1, -1); 11609 pAudioPlayer->StopChannels(-1, -1);
11614 UI_CreateTravelDialogue(); 11610 UI_CreateTravelDialogue();
11615 } 11611 }
11616 } 11612 }
11617 UpdateActors_ODM(); 11613 UpdateActors_ODM();
11618 _46CC4B_check_event_triggers(); 11614 check_event_triggers();
11619 } 11615 }
11620 11616
11621 11617
11622 11618
11623 11619