comparison Player.cpp @ 1747:cecb080929c4

Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
author Grumpy7
date Mon, 30 Sep 2013 05:48:32 +0200
parents ef86fc6d6a80
children 421c29d4ab3e 845a6503f55c
comparison
equal deleted inserted replaced
1738:ef86fc6d6a80 1747:cecb080929c4
5092 case VAR_Counter6: 5092 case VAR_Counter6:
5093 case VAR_Counter7: 5093 case VAR_Counter7:
5094 case VAR_Counter8: 5094 case VAR_Counter8:
5095 case VAR_Counter9: 5095 case VAR_Counter9:
5096 case VAR_Counter10: 5096 case VAR_Counter10:
5097 if (pParty->field_3C.CounterEventValues[VarNum - VAR_Counter1]) //originally (signed __int64)(__PAIR__(*(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44304], *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44300]) 5097 if (pParty->PartyTimes.CounterEventValues[VarNum - VAR_Counter1]) //originally (signed __int64)(__PAIR__(*(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44304], *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44300])
5098 { 5098 {
5099 return (pParty->field_3C.CounterEventValues[VarNum - VAR_Counter1] + 460800 * pValue * 0.033333335) <= pParty->uTimePlayed ; 5099 return (pParty->PartyTimes.CounterEventValues[VarNum - VAR_Counter1] + 460800 * pValue * 0.033333335) <= pParty->uTimePlayed ;
5100 } 5100 }
5101 case VAR_ReputationInCurrentLocation: 5101 case VAR_ReputationInCurrentLocation:
5102 v19 = &pOutdoor->ddm; 5102 v19 = &pOutdoor->ddm;
5103 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) 5103 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
5104 v19 = &pIndoor->dlv; 5104 v19 = &pIndoor->dlv;
5465 if ( var_type == VAR_GoldInBank ) 5465 if ( var_type == VAR_GoldInBank )
5466 { 5466 {
5467 pParty->uNumGoldInBank = var_value; 5467 pParty->uNumGoldInBank = var_value;
5468 return; 5468 return;
5469 } 5469 }
5470 if ( var_type <= VAR_Counter8 ) 5470 if ( var_type <= VAR_Counter10 )
5471 { 5471 {
5472 if ( (signed int)var_type >= 0xF5 ) 5472 if ( (signed int)var_type >= 0xF5 )
5473 { 5473 {
5474 __debugbreak(); //how do I get here? 5474 pParty->PartyTimes.CounterEventValues[var_type - VAR_Counter1] = pParty->uTimePlayed; // *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44300] = LODWORD(pParty->uTimePlayed);*(int *)&stru_AA1058[3].pSounds[8 * var_type + 44304] = HIDWORD(pParty->uTimePlayed);
5475 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44300] = LODWORD(pParty->uTimePlayed);
5476 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44304] = HIDWORD(pParty->uTimePlayed);
5477 } 5475 }
5478 else 5476 else
5479 { 5477 {
5480 switch ( var_type ) 5478 switch ( var_type )
5481 { 5479 {
5482 case VAR_PlayerBits: 5480 case VAR_PlayerBits:
5483 __debugbreak(); //how do I get here?
5484 _449B7E_toggle_bit((unsigned char *)field_1A50, var_value, 1u); 5481 _449B7E_toggle_bit((unsigned char *)field_1A50, var_value, 1u);
5485 break; 5482 break;
5486 case VAR_NPCs2: 5483 case VAR_NPCs2:
5487 __debugbreak(); //how do I get here?
5488 pParty->field_709 = 0; 5484 pParty->field_709 = 0;
5489 LOBYTE(pNPCStats->pNewNPCData[var_value].uFlags) |= 0x80u; 5485 LOBYTE(pNPCStats->pNewNPCData[var_value].uFlags) |= 0x80u;
5490 pParty->CountHirelings(); 5486 pParty->CountHirelings();
5491 viewparams->bRedrawGameUI = true; 5487 viewparams->bRedrawGameUI = true;
5492 break; 5488 break;
5495 break; 5491 break;
5496 } 5492 }
5497 } 5493 }
5498 return; 5494 return;
5499 } 5495 }
5500 if ( var_type < VAR_Counter9 ) 5496 if ( var_type <= VAR_Counter10 )
5501 return; 5497 return;
5502 if ( (signed int)var_type <= 0x112 ) 5498 if ( (signed int)var_type <= VAR_UnknownTimeEvent19 )
5503 { 5499 {
5504 __debugbreak(); //how do I get here? 5500 pParty->PartyTimes._s_times[var_type - VAR_UnknownTimeEvent0] = pParty->uTimePlayed; //*(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed);, *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed);
5505 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed);
5506 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed);
5507 } 5501 }
5508 else 5502 else
5509 { 5503 {
5510 if ( var_type == VAR_ReputationInCurrentLocation ) 5504 if ( var_type == VAR_ReputationInCurrentLocation )
5511 { 5505 {
5517 v24->uReputation = 10000; 5511 v24->uReputation = 10000;
5518 return; 5512 return;
5519 } 5513 }
5520 if ( var_type <= VAR_ReputationInCurrentLocation 5514 if ( var_type <= VAR_ReputationInCurrentLocation
5521 || var_type > VAR_History_28 5515 || var_type > VAR_History_28
5522 || (v22 = var_type - 276, pParty->field_3C.field_4F0[2 * v22 + 1] | pParty->field_3C.field_4F0[2 * v22]) 5516 || (v22 = var_type - VAR_History_0, pParty->PartyTimes.HistoryEventTimes[v22])
5523 || (pParty->field_3C.field_4F0[2 * (var_type - 276)] = LODWORD(pParty->uTimePlayed), 5517 || (pParty->PartyTimes.HistoryEventTimes[v22] = pParty->uTimePlayed,
5524 v23 = pStorylineText->StoreLine[v22].pText == 0,//*(&pStorylineText->field_0 + 3 * v22) == 0, 5518 v23 = pStorylineText->StoreLine[v22].pText == 0,//*(&pStorylineText->field_0 + 3 * v22) == 0,
5525 pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed),
5526 v23) ) 5519 v23) )
5527 __debugbreak(); //how do I get here?
5528 return; 5520 return;
5529 bFlashHistoryBook = 1; 5521 bFlashHistoryBook = 1;
5530 } 5522 }
5531 v25 = 8 * currPlayerId + 400; 5523 v25 = 8 * currPlayerId + 400;
5532 LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); 5524 LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112);
6484 } 6476 }
6485 if ( var_type != VAR_ReputationInCurrentLocation ) 6477 if ( var_type != VAR_ReputationInCurrentLocation )
6486 { 6478 {
6487 if ( var_type <= VAR_ReputationInCurrentLocation 6479 if ( var_type <= VAR_ReputationInCurrentLocation
6488 || var_type > VAR_History_28 6480 || var_type > VAR_History_28
6489 || (v25 = var_type - 276, pParty->field_3C.field_4F0[2 * v25 + 1] | pParty->field_3C.field_4F0[2 * v25]) 6481 || (v25 = var_type - 276, pParty->PartyTimes.HistoryEventTimes[v25])
6490 || (pParty->field_3C.field_4F0[2 * (var_type - 276)] = LODWORD(pParty->uTimePlayed), 6482 || (pParty->PartyTimes.HistoryEventTimes[var_type - 276] = pParty->uTimePlayed,
6491 v26 = pStorylineText->StoreLine[v25].pText==0,//*(&pStorylineText->field_0 + 3 * v25) == 0, 6483 v26 = pStorylineText->StoreLine[v25].pText==0,//*(&pStorylineText->field_0 + 3 * v25) == 0,
6492 pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed),
6493 v26) ) 6484 v26) )
6494 return; 6485 return;
6495 bFlashHistoryBook = 1; 6486 bFlashHistoryBook = 1;
6496 _play_sound: 6487 _play_sound:
6497 v28 = 8 * uPlayerIdx + 400; 6488 v28 = 8 * uPlayerIdx + 400;