changeset 1793:4dee76d79c78

dword_5B65CC to npcIdToDismissAfterDialogue, Party::field_709 to Party::hirelingScrollPosition
author Grumpy7
date Sun, 06 Oct 2013 09:19:12 +0200
parents 3155be890554
children 3f1e09a71726
files CastSpellInfo.cpp NPC.cpp Party.cpp Party.h Player.cpp UI/UiGame.cpp mm7_4.cpp mm7_5.cpp mm7_data.cpp mm7_data.h
diffstat 10 files changed, 37 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/CastSpellInfo.cpp	Thu Oct 03 09:35:51 2013 +0200
+++ b/CastSpellInfo.cpp	Sun Oct 06 09:19:12 2013 +0200
@@ -3833,7 +3833,7 @@
 			}
 			v608 = pCastSpell->uPlayerID_2;
 			if ( v608 != 4 && v608 != 5
-				|| (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0)
+				|| (v609 = (signed int)*(&pFontCChar + v608 + pParty->hirelingScrollPosition), v609 <= 0)
 				|| v609 >= 3 )
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
--- a/NPC.cpp	Thu Oct 03 09:35:51 2013 +0200
+++ b/NPC.cpp	Sun Oct 06 09:19:12 2013 +0200
@@ -1520,7 +1520,7 @@
   }
   //LOBYTE(v2->uFlags) |= 0x80u;
   pCurrentNPCInfo->uFlags |= 128;
-  pParty->field_709 = 0;
+  pParty->hirelingScrollPosition = 0;
   pParty->CountHirelings();
   if ( pParty->pHirelings[0].pName )
   {
@@ -1535,7 +1535,7 @@
     v22 = pParty->pHireling1Name;
   }
   strcpy(v22, v24);
-  pParty->field_709 = 0;
+  pParty->hirelingScrollPosition = 0;
   pParty->CountHirelings();
   PrepareHouse((HOUSE_ID)(int)window_SpeakInHouse->ptr_1C);
   dialog_menu_id = HOUSE_DIALOGUE_MAIN;
--- a/Party.cpp	Thu Oct 03 09:35:51 2013 +0200
+++ b/Party.cpp	Sun Oct 06 09:19:12 2013 +0200
@@ -355,7 +355,7 @@
 
   pHireling1Name[0] = 0;
   pHireling2Name[0] = 0;
-  pParty->field_709 = 0;
+  pParty->hirelingScrollPosition = 0;
   memset(pHirelings, 0, 2 * sizeof(*pHirelings));
 
   strcpy(this->pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]); //Zoltan
@@ -1042,7 +1042,7 @@
       Assert(sizeof(NPCData) == 0x4C);
       memset(hireling, 0, sizeof(*hireling));
 
-      pParty->field_709 = 0;
+      pParty->hirelingScrollPosition = 0;
       pParty->CountHirelings();
       viewparams->bRedrawGameUI = true;
     }
--- a/Party.h	Thu Oct 03 09:35:51 2013 +0200
+++ b/Party.h	Sun Oct 06 09:19:12 2013 +0200
@@ -242,7 +242,7 @@
   int uFallStartY;
   unsigned int bFlying;
   char field_708;
-  char field_709;
+  unsigned __int8 hirelingScrollPosition;
   char field_70A;
   char field_70B;
   unsigned int uCurrentYear;
--- a/Player.cpp	Thu Oct 03 09:35:51 2013 +0200
+++ b/Player.cpp	Sun Oct 06 09:19:12 2013 +0200
@@ -5809,7 +5809,7 @@
       _449B7E_toggle_bit((unsigned char *)field_1A50, var_value, 1u);
       return;
     case VAR_NPCs2:
-      pParty->field_709 = 0;
+      pParty->hirelingScrollPosition = 0;
       LOBYTE(pNPCStats->pNewNPCData[var_value].uFlags) |= 0x80u;
       pParty->CountHirelings();
       viewparams->bRedrawGameUI = true;
@@ -6400,7 +6400,7 @@
       _449B7E_toggle_bit((unsigned char *)this->field_1A50, val, 1u);
       return;
     case VAR_NPCs2:
-      pParty->field_709 = 0;
+      pParty->hirelingScrollPosition = 0;
       LOBYTE(pNPCStats->pNewNPCData[val].uFlags) |= 0x80u;
       pParty->CountHirelings();
       viewparams->bRedrawGameUI = true;
@@ -6639,14 +6639,14 @@
               VarNum = (VariableType)0;
               GetNewNPCData(sDialogue_SpeakingActorNPC_ID, (int*)&VarNum);
               result = (bool) pValue;
-			  dword_5B65CC = 0;
+			  npcIdToDismissAfterDialogue = 0;
               if ( (int)VarNum == pValue )
               {
-                dword_5B65CC = (int)pValue;
+                npcIdToDismissAfterDialogue = (int)pValue;
               }
               else
               {
-                pParty->field_709 = 0;
+                pParty->hirelingScrollPosition = 0;
                 LOBYTE(pNPCStats->pNewNPCData[(int)pValue].uFlags) &= 0x7Fu;
                 pParty->CountHirelings();
                 viewparams->bRedrawGameUI = true;
@@ -6674,7 +6674,7 @@
                 memset(pParty->pHirelings, 0, 0x4Cu);
               if ( pParty->pHirelings[1].uProfession == pValue )
                 memset(&pParty->pHirelings[1], 0, 0x4Cu);
-              pParty->field_709 = 0;
+              pParty->hirelingScrollPosition = 0;
               pParty->CountHirelings();
               break;
             case 243:
--- a/UI/UiGame.cpp	Thu Oct 03 09:35:51 2013 +0200
+++ b/UI/UiGame.cpp	Sun Oct 06 09:19:12 2013 +0200
@@ -187,9 +187,9 @@
         }
       }
     }
-    if ( (signed int)((char *)_this + (unsigned __int8)pParty->field_709) < v1 )
+    if ( (signed int)((char *)_this + pParty->hirelingScrollPosition) < v1 )
     {
-      sDialogue_SpeakingActorNPC_ID = -1 - (unsigned __int8)pParty->field_709 - (int)_this;
+      sDialogue_SpeakingActorNPC_ID = -1 - pParty->hirelingScrollPosition - (int)_this;
       pNPC = GetNewNPCData(sDialogue_SpeakingActorNPC_ID, &a2);
       if ( pNPC )
       {
@@ -2161,7 +2161,7 @@
       }
     }
 
-    for ( int i = (unsigned __int8)pParty->field_709; i < v22 && pNPC_limit_ID < 2; i++ )
+    for ( int i = pParty->hirelingScrollPosition; i < v22 && pNPC_limit_ID < 2; i++ )
     {
       if ( (unsigned __int8)pTmpBuf[i] >= 2 )
       {
--- a/mm7_4.cpp	Thu Oct 03 09:35:51 2013 +0200
+++ b/mm7_4.cpp	Sun Oct 06 09:19:12 2013 +0200
@@ -1405,7 +1405,7 @@
   int v8; // [sp+Ch] [bp-8h]@3
   int v9; // [sp+10h] [bp-4h]@2
   int a2a; // [sp+1Ch] [bp+8h]@1
-
+  return 0;
   v3 = 0;
   result = word_4EE088_sound_ids[uSoundID];
   v5 = this;
@@ -3446,7 +3446,7 @@
 				v11 = &pParty->pHirelings[1];
 				memset(v11, 0, sizeof(NPCData));
 			}
-			pParty->field_709 = 0;
+			pParty->hirelingScrollPosition = 0;
 			pParty->CountHirelings();
 			dword_591084 = 0;
 			pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
@@ -3494,7 +3494,7 @@
 				v13 = pParty->pHireling1Name;
 			}
 			strcpy(v13, v15);
-			pParty->field_709 = 0;
+			pParty->hirelingScrollPosition = 0;
 			pParty->CountHirelings();
 
 			pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
@@ -3555,7 +3555,7 @@
 				v11 = &pParty->pHirelings[1];
 				memset(v11, 0, sizeof(NPCData));
 			}
-			pParty->field_709 = 0;
+			pParty->hirelingScrollPosition = 0;
 			pParty->CountHirelings();
 			dword_591084 = 0;
 			pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
--- a/mm7_5.cpp	Thu Oct 03 09:35:51 2013 +0200
+++ b/mm7_5.cpp	Sun Oct 06 09:19:12 2013 +0200
@@ -357,11 +357,11 @@
               //while ( _this < (signed int)pNPCStats->uNumNewNPCs );
             }
 
-            if ( (signed int)(hireling_idx + (unsigned __int8)pParty->field_709) < uAction )
+            if ( (signed int)(hireling_idx + pParty->hirelingScrollPosition) < uAction )
             {
               //Actor::Actor(&actor);
               memset(&actor, 0, 0x344u);
-              actor.sNPC_ID += -1 - (unsigned __int8)pParty->field_709 - hireling_idx;
+              actor.sNPC_ID += -1 - pParty->hirelingScrollPosition - hireling_idx;
               pActor = &actor;
               GameUI_InitializeDialogue(&actor, true);
             }
@@ -1343,26 +1343,26 @@
                       if ( uCurrentHouse_Animation == 153 )
                         PlayHouseSound(0x99u, HouseSound_Greeting_2);
                       pVideoPlayer->Unload();
-                      if ( dword_5B65CC )
+                      if ( npcIdToDismissAfterDialogue )
                       {
-                        pParty->field_709 = 0;
-                        LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu;
+                        pParty->hirelingScrollPosition = 0;
+                        LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu;
                         pParty->CountHirelings();
                         viewparams->bRedrawGameUI = true;
-                        dword_5B65CC = 0;
+                        npcIdToDismissAfterDialogue = 0;
                       }
                       DialogueEnding();
                       pCurrentScreen = SCREEN_GAME;
                       viewparams->bRedrawGameUI = true;
                       continue;
                     case SCREEN_NPC_DIALOGUE://click escape
-                      if ( dword_5B65CC )
+                      if ( npcIdToDismissAfterDialogue )
                       {
-                        pParty->field_709 = 0;
-                        LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu;
+                        pParty->hirelingScrollPosition = 0;
+                        LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu;
                         pParty->CountHirelings();
                         viewparams->bRedrawGameUI = true;
-                        dword_5B65CC = 0;
+                        npcIdToDismissAfterDialogue = 0;
                       }
                       //goto LABEL_317;
                       DialogueEnding();
@@ -1574,22 +1574,22 @@
           {
             GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0);
             v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2;
-            if ( (unsigned __int8)pParty->field_709 < v37 )
+            if ( pParty->hirelingScrollPosition < v37 )
             {
-              ++pParty->field_709;//??? maybe number of the first cell???
-              if ( (unsigned __int8)pParty->field_709 >= v37 )
-                pParty->field_709 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2;
+              ++pParty->hirelingScrollPosition;//??? maybe number of the first cell???
+              if ( pParty->hirelingScrollPosition >= v37 )
+                pParty->hirelingScrollPosition = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2;
             }
           }
           else
           {
             GUIWindow::Create(469, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCLeft, 0);
-            if ( pParty->field_709 )
+            /*if ( pParty->field_709 )
             {
               --pParty->field_709;
               if ( pParty->field_709 < 1 )
                 pParty->field_709 = 0;
-            }
+            }*/
           }
           GameUI_DrawHiredNPCs();
           continue;
--- a/mm7_data.cpp	Thu Oct 03 09:35:51 2013 +0200
+++ b/mm7_data.cpp	Sun Oct 06 09:19:12 2013 +0200
@@ -1055,7 +1055,7 @@
 int dword_5B65C0; // weak
 int dword_5B65C4; // weak
 int dword_5B65C8_timers_count; // weak
-int dword_5B65CC; // weak
+int npcIdToDismissAfterDialogue; // weak
 signed int dword_5B65D0_dialogue_actor_npc_id; // weak
 int dword_5C3418; // weak
 int dword_5C341C; // weak
--- a/mm7_data.h	Thu Oct 03 09:35:51 2013 +0200
+++ b/mm7_data.h	Sun Oct 06 09:19:12 2013 +0200
@@ -703,7 +703,7 @@
 extern int dword_5B65C0; // weak
 extern int dword_5B65C4; // weak
 extern int dword_5B65C8_timers_count; // weak
-extern int dword_5B65CC; // weak
+extern int npcIdToDismissAfterDialogue; // weak
 extern int dword_5B65D0_dialogue_actor_npc_id; // weak
 extern int dword_5C3418; // weak
 extern int dword_5C341C; // weak