Mercurial > mm7
diff mm7_5.cpp @ 1430:71a2cf416478
LloydBeacons
author | Ritor1 |
---|---|
date | Fri, 02 Aug 2013 13:48:57 +0600 |
parents | 9a1adf08f4ed |
children | 8b4f4c723edd |
line wrap: on
line diff
--- a/mm7_5.cpp Thu Aug 01 17:51:16 2013 +0600 +++ b/mm7_5.cpp Fri Aug 02 13:48:57 2013 +0600 @@ -112,10 +112,10 @@ int v56; // edx@432 int v57; // eax@432 Player *pPlayer; // edx@442 - unsigned int v59; // eax@445 + unsigned int pMapNum; // eax@445 signed int v60; // ST64_4@459 - NPCData *pNPCData2; // eax@467 - unsigned __int64 v62; // kr00_8@467 + //NPCData *pNPCData2; // eax@467 + //unsigned __int64 v62; // kr00_8@467 __int16 v63; // dx@479 unsigned int v64; // eax@486 int v65; // ecx@486 @@ -205,7 +205,7 @@ int v155; // [sp-4h] [bp-600h]@165 int v156; // [sp-4h] [bp-600h]@204 //const char *v157; // [sp-4h] [bp-600h]@444 - unsigned int v158; // [sp-4h] [bp-600h]@449 + //unsigned int v158; // [sp-4h] [bp-600h]@449 //__int16 v159; // [sp-4h] [bp-600h]@550 int v160; // [sp-4h] [bp-600h]@599 const char *v161; // [sp-4h] [bp-600h]@637 @@ -232,7 +232,7 @@ signed int thisb; // [sp+14h] [bp-5E8h]@272 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377 - char *thise; // [sp+14h] [bp-5E8h]@445 + char *pMapName; // [sp+14h] [bp-5E8h]@445 Player *pPlayer9; // [sp+14h] [bp-5E8h]@455 int thisg; // [sp+14h] [bp-5E8h]@467 int thish; // [sp+14h] [bp-5E8h]@528 @@ -259,7 +259,7 @@ POINT v209; // [sp+78h] [bp-584h]@777 POINT v210; // [sp+80h] [bp-57Ch]@397 POINT v211; // [sp+88h] [bp-574h]@704 - __int64 v212; // [sp+90h] [bp-56Ch]@467 + //__int64 v212; // [sp+90h] [bp-56Ch]@467 int v213; // [sp+98h] [bp-564h]@385 char pLevelName[32]; // [sp+9Ch] [bp-560h]@380 char pOut[32]; // [sp+BCh] [bp-540h]@370 @@ -1666,7 +1666,7 @@ pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; dword_50CDC8 = 1; sub_42FBDD(); - pNPCData4 = (NPCData *)GetTravelTime(); + //pNPCData4 = (NPCData *)GetTravelTime(); strcpy(pOutdoor->pLevelFilename, pCurrentMapName.data()); if ( bUnderwater != 1 && pParty->bFlying || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) @@ -1695,11 +1695,11 @@ ++pGameLoadingUI_ProgressBar->uProgressMax; SaveGame(1, 0); pGameLoadingUI_ProgressBar->Progress(); - RestAndHeal(1440 * (signed int)pNPCData4); + RestAndHeal(1440 * (signed int)GetTravelTime()); if ( pParty->uNumFoodRations ) { pParty->RestAndHeal(); - if ( ((pParty->uNumFoodRations - (signed int)pNPCData4) & 0x80000000u) != 0 ) + if ( ((pParty->uNumFoodRations - (signed int)GetTravelTime()) & 0x80000000u) != 0 ) { pPlayer7 = pParty->pPlayers; do @@ -1710,7 +1710,7 @@ while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings ); ++pParty->days_played_without_rest; } - Party::TakeFood((unsigned int)pNPCData4); + Party::TakeFood((unsigned int)GetTravelTime()); } else { @@ -1964,26 +1964,25 @@ uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam]; if ( bRecallingBeacon ) { - if ( !*((int *)&pSavegameThumbnails.data()->pPixels + 10 * uMessageParam) ) + if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) ) continue; - v173 = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(pPlayer->pInstalledBeacons[uMessageParam].field_18))].pName; + v173 = pMapStats->pInfos[sub_410D99_get_map_index(pPlayer->pInstalledBeacons[uMessageParam].SaveFileID)].pName; sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s" GameUI_SetFooterString(pTmpBuf.data()); continue; } - v59 = pMapStats->GetMapInfo(pCurrentMapName.data()); - thise = "Not in Map Stats"; - if ( v59 ) - thise = pMapStats->pInfos[v59].pName; - if ( !*((int *)&pSavegameThumbnails.data()->pPixels + 10 * uMessageParam) || !v59 ) + pMapNum = pMapStats->GetMapInfo(pCurrentMapName.data()); + pMapName = "Not in Map Stats"; + if ( pMapNum ) + pMapName = pMapStats->pInfos[pMapNum].pName; + if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) || !pMapNum ) { - sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], thise);// "Set to %s" + sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], pMapName);// "Set to %s" GameUI_SetFooterString(pTmpBuf.data()); continue; } v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; - v158 = (unsigned int)thise; - sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" + sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], (unsigned int)pMapName, v174);// "Set %s over %s" GameUI_SetFooterString(pTmpBuf.data()); continue; case UIMSG_CloseAfterInstallBeacon: @@ -1998,8 +1997,7 @@ continue; case UIMSG_InstallBeacon: pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; - pNPCData4 = (NPCData *)&pPlayer9->pInstalledBeacons[uMessageParam]; - if ( !*(_QWORD *)&pNPCData4->pName && bRecallingBeacon ) + if ( !pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime && bRecallingBeacon ) continue; byte_506360 = 1; pPlayer9->CanCastSpell(uRequiredMana); @@ -2017,38 +2015,30 @@ pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[dword_506338], 0, 0, -1, 0, dword_50633C, 0, 0); if ( bRecallingBeacon ) { - if ( _stricmp(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]) ) + if ( _stricmp(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]) ) { SaveGame(1, 0); OnMapLeave(); - strcpy(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]); + strcpy(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]); dword_6BE364_game_settings_1 |= 1; uGameState = GAME_STATE_2; - _5B65A8_npcdata_uflags_or_other = pNPCData4->uFlags; - _5B65AC_npcdata_fame_or_other = pNPCData4->fame; - _5B65B0_npcdata_rep_or_other = pNPCData4->rep; - _5B65B4_npcdata_loword_house_or_other = LOWORD(pNPCData4->Location2D); - _5B65B8_npcdata_hiword_house_or_other = HIWORD(pNPCData4->Location2D); + _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; + _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; + _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; + _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; + _5B65B8_npcdata_hiword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; dword_5B65C0 = 1; } else { - pParty->vPosition.x = pNPCData4->uFlags; - pParty->vPosition.y = pNPCData4->fame; - pParty->vPosition.z = pNPCData4->rep; + pParty->vPosition.x = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; + pParty->vPosition.y = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; + pParty->vPosition.z = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; pParty->uFallStartY = pParty->vPosition.z; - pParty->sRotationY = LOWORD(pNPCData4->Location2D); - pParty->sRotationX = HIWORD(pNPCData4->Location2D); + pParty->sRotationY = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; + pParty->sRotationX = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; } pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - //crt_deconstruct_ptr_6A0118(); pBooksWindow->Release(); pGUIWindow_CurrentMenu->Release(); pBooksWindow = 0; @@ -2059,28 +2049,19 @@ sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1); SaveScreenshot(a1); LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1); - v212 = qword_506350 << 7; - pNPCData2 = pNPCData4; - thisg = 0; - v62 = pParty->uTimePlayed + (signed __int64)((double)(qword_506350 << 7) * 0.033333335); - pNPCData4->pName = (char *)v62; - pNPCData2->uPortraitID = HIDWORD(v62); - pNPCData2->uFlags = pParty->vPosition.x; - pNPCData2->fame = pParty->vPosition.y; - pNPCData2->rep = pParty->vPosition.z; - LOWORD(pNPCData2->Location2D) = LOWORD(pParty->sRotationY); - HIWORD(pNPCData2->Location2D) = LOWORD(pParty->sRotationX); + pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime = pParty->uTimePlayed + (signed __int64)((double)(qword_506350 << 7) * 0.033333335); + pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X = pParty->vPosition.x; + pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y = pParty->vPosition.y; + pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z = pParty->vPosition.z; + pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X = LOWORD(pParty->sRotationY); + pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y = LOWORD(pParty->sRotationX); if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 ) continue; - uAction = 0; - while ( _stricmp((const char *)pGames_LOD->pSubIndices + uAction, pCurrentMapName.data()) ) + for ( thisg = 0; thisg < (signed int)pGames_LOD->uNumSubDirs / 2; ++thisg ) { - ++thisg; - uAction += 32; - if ( thisg >= (signed int)pGames_LOD->uNumSubDirs / 2 ) - continue; + if ( !_stricmp((const char *)pGames_LOD->pSubIndices[thisg].pFilename, pCurrentMapName.data()) ) + pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID = thisg; } - HIWORD(pNPCData4->uProfession) = thisg; } continue; case UIMSG_ClickTownInTP: @@ -3017,8 +2998,8 @@ continue; case UIMSG_ShowStatus_Funds: v174 = (char *)pParty->uNumGoldInBank; - v158 = pParty->uNumGold + pParty->uNumGoldInBank; - sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], v158, v174);// "You have %d total gold, %d in the Bank" + //v158 = pParty->uNumGold + pParty->uNumGoldInBank; + sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], pParty->uNumGold + pParty->uNumGoldInBank, v174);// "You have %d total gold, %d in the Bank" GameUI_SetFooterString(pTmpBuf.data()); continue; case UIMSG_ShowStatus_DateTime: