diff 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
line wrap: on
line diff
--- a/Player.cpp	Fri Sep 27 10:08:01 2013 +0200
+++ b/Player.cpp	Mon Sep 30 05:48:32 2013 +0200
@@ -5094,9 +5094,9 @@
       case VAR_Counter8:
       case VAR_Counter9:
       case VAR_Counter10:
-        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])
+        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])
         {
-          return (pParty->field_3C.CounterEventValues[VarNum - VAR_Counter1] + 460800 * pValue * 0.033333335) <= pParty->uTimePlayed ;
+          return (pParty->PartyTimes.CounterEventValues[VarNum - VAR_Counter1] + 460800 * pValue * 0.033333335) <= pParty->uTimePlayed ;
         }
       case VAR_ReputationInCurrentLocation:
         v19 = &pOutdoor->ddm;
@@ -5467,24 +5467,20 @@
         pParty->uNumGoldInBank = var_value;
         return;
       }
-      if ( var_type <= VAR_Counter8 )
+      if ( var_type <= VAR_Counter10 )
       {
         if ( (signed int)var_type >= 0xF5 )
         {
-          __debugbreak(); //how do I get here?
-          *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44300] = LODWORD(pParty->uTimePlayed);
-          *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44304] = HIDWORD(pParty->uTimePlayed);
+          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);
         }
         else
         {
           switch ( var_type )
           {
             case VAR_PlayerBits:
-              __debugbreak(); //how do I get here?
               _449B7E_toggle_bit((unsigned char *)field_1A50, var_value, 1u);
               break;
             case VAR_NPCs2:
-              __debugbreak(); //how do I get here?
               pParty->field_709 = 0;
               LOBYTE(pNPCStats->pNewNPCData[var_value].uFlags) |= 0x80u;
               pParty->CountHirelings();
@@ -5497,13 +5493,11 @@
         }
         return;
       }
-      if ( var_type < VAR_Counter9 )
+      if ( var_type <= VAR_Counter10 )
         return;
-      if ( (signed int)var_type <= 0x112 )
+      if ( (signed int)var_type <= VAR_UnknownTimeEvent19 )
       {
-        __debugbreak(); //how do I get here?
-        *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed);
-        *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed);
+        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);
       }
       else
       {
@@ -5519,12 +5513,10 @@
         }
         if ( var_type <= VAR_ReputationInCurrentLocation
           || var_type > VAR_History_28
-          || (v22 = var_type - 276, pParty->field_3C.field_4F0[2 * v22 + 1] | pParty->field_3C.field_4F0[2 * v22])
-          || (pParty->field_3C.field_4F0[2 * (var_type - 276)] = LODWORD(pParty->uTimePlayed),
+          || (v22 = var_type - VAR_History_0, pParty->PartyTimes.HistoryEventTimes[v22])
+          || (pParty->PartyTimes.HistoryEventTimes[v22] = pParty->uTimePlayed,
               v23 = pStorylineText->StoreLine[v22].pText == 0,//*(&pStorylineText->field_0 + 3 * v22) == 0,
-              pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed),
               v23) )
-              __debugbreak(); //how do I get here?
           return;
         bFlashHistoryBook = 1;
       }
@@ -6486,10 +6478,9 @@
     {
       if ( var_type <= VAR_ReputationInCurrentLocation
         || var_type > VAR_History_28
-        || (v25 = var_type - 276, pParty->field_3C.field_4F0[2 * v25 + 1] | pParty->field_3C.field_4F0[2 * v25])
-        || (pParty->field_3C.field_4F0[2 * (var_type - 276)] = LODWORD(pParty->uTimePlayed),
+        || (v25 = var_type - 276, pParty->PartyTimes.HistoryEventTimes[v25])
+        || (pParty->PartyTimes.HistoryEventTimes[var_type - 276] = pParty->uTimePlayed,
             v26 = pStorylineText->StoreLine[v25].pText==0,//*(&pStorylineText->field_0 + 3 * v25) == 0,
-            pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed),
             v26) )
         return;
       bFlashHistoryBook = 1;