diff mm7_4.cpp @ 130:1c471f3629fb

Party expressions update
author Nomad
date Mon, 11 Feb 2013 19:40:49 +0200
parents 3471df3713e2
children 9b0d651821f1
line wrap: on
line diff
--- a/mm7_4.cpp	Mon Feb 11 18:22:21 2013 +0200
+++ b/mm7_4.cpp	Mon Feb 11 19:40:49 2013 +0200
@@ -3128,7 +3128,7 @@
         v10 = (unsigned __int8)pTmpBuf[i];
         if ( pParty->pHirelings[v10].bDrawSomeAnim == 1 )
         {
-          uFrameID = pParty->pHirelings[v10].evtb;
+          uFrameID = pParty->pHirelings[v10]._anim_current_time;
           v11 = pHiredNPCsIconsOffsetsX[v9];
           v12 = pHiredNPCsIconsOffsetsY[v9];
           v17 = v11;
@@ -3236,14 +3236,14 @@
     }
       v7 = 0;
       for (uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j)
-        if (pPlayerFrameTable->pFrames[j].uSequenceID == pPlayer->uExpressionID)
+        if (pPlayerFrameTable->pFrames[j].expression == pPlayer->expression)
         {
           v7 = j;
           break;
         }
     if ( v7 == 0 )
       v7 = 1;
-    if (pPlayer->uExpressionID == 21 )
+    if (pPlayer->expression == CHARACTER_EXPRESSION_21)
       pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->field_1AA8, &pPlayer->field_1AA4, pMiscTimer->uTimeElapsed);
     else
       pFrame = pPlayerFrameTable->GetFrameBy_x(v7, pPlayer->uExpressionTimePassed);
@@ -3968,7 +3968,7 @@
         }
         v13 = pPlayers[v12];
       }
-      v13->PlayEmotion(37, v58);
+      v13->PlayEmotion(CHARACTER_EXPRESSION_37, v58);
 LABEL_39:
       ++v12;
       if ( v12 > 4 )
@@ -4309,7 +4309,7 @@
 
 
 //----- (00494AED) --------------------------------------------------------
-unsigned int PlayerFrameTable::GetFrameIdBy_field0(int uField0)
+unsigned int PlayerFrameTable::GetFrameIdByExpression(CHARACTER_EXPRESSION_ID expression)
 {
   unsigned int _uNumFrames; // edx@1
   unsigned int result; // eax@1
@@ -4325,7 +4325,7 @@
   else
   {
     v4 = this->pFrames;
-    while ( v4->uSequenceID != uField0 )
+    while ( v4->expression != expression )
     {
       ++result;
       ++v4;
@@ -4492,7 +4492,7 @@
     {
       v8 = atoi(v24.pProperties[0]);
       v9 = v24.pProperties[1];
-      v2->pFrames[v2->uNumFrames].uSequenceID = v8;
+      v2->pFrames[v2->uNumFrames].expression = (CHARACTER_EXPRESSION_ID)v8;
       v10 = atoi(v9);
       v11 = v24.pProperties[2];
       v2->pFrames[v2->uNumFrames].uTextureID = v10;
@@ -9241,7 +9241,7 @@
     ++v6;
   }
   while ( v6 <= &pParty->pPlayers[3] );
-  pParty->_4909F4();
+  pParty->UpdatePlayersAndHirelingsEmotions();
 }
 // 507B94: using guessed type int dword_507B94;
 
@@ -9506,10 +9506,10 @@
           v3 = v2->bDrawSomeAnim;
           break;
         case 20:
-          v3 = v2->evtb;
+          v3 = v2->_anim_current_time;
           break;
         case 21:
-          v3 = v2->evtc;
+          v3 = v2->_anim_end_time;
           break;
         default:
           if ( a1 != 22 )
@@ -9630,14 +9630,14 @@
                 v2->bDrawSomeAnim = 0;
               break;
             case 20:
-              v9 = v2->evtb;
+              v9 = v2->_anim_current_time;
               if ( v9 >= 400 && v9 <= 416 )
-                v2->evtb = 0;
+                v2->_anim_current_time = 0;
               break;
             case 21:
-              v8 = v2->evtc;
+              v8 = v2->_anim_end_time;
               if ( v8 >= 400 && v8 <= 416 )
-                v2->evtc = 0;
+                v2->_anim_end_time = 0;
               break;
             case 22:
               v7 = v2->evtd;
@@ -10321,7 +10321,7 @@
           v20 = v19 - 1;
           if ( !v20 )
           {
-			v15 = (char *)pNPCTopics[v58->evtb-1].pTopic;//(&dword_721660)[8 * v58->evtb];
+            v15 = (char *)pNPCTopics[v58->_anim_current_time-1].pTopic;//(&dword_721660)[8 * v58->evtb];
             if ( !v15 )
             {
               v16->uControlParam = 0;
@@ -10337,7 +10337,7 @@
           v21 = v20 - 1;
           if ( !v21 )
           {
-            v23 = v58->evtc;
+            v23 = v58->_anim_end_time;
             goto LABEL_33;
           }
           v22 = v21 - 1;
@@ -11417,7 +11417,7 @@
               0);
         }
       }
-      v7 = (void *)v17->evtb;
+      v7 = (void *)v17->_anim_current_time;
       if ( v7 )
       {
         if ( v1 < 4 )
@@ -11438,7 +11438,7 @@
               0);
         }
       }
-      v9 = (void *)v17->evtc;
+      v9 = (void *)v17->_anim_end_time;
       if ( v9 )
       {
         if ( v1 < 4 )
@@ -12837,12 +12837,12 @@
   }
   if ( v3 == 20 )
   {
-    v4 = v2->evtb;
+    v4 = v2->_anim_current_time;
     goto LABEL_74;
   }
   if ( v3 == 21 )
   {
-    v4 = v2->evtc;
+    v4 = v2->_anim_end_time;
 LABEL_74:
     if ( v4 < 200 || v4 > 310 )
     {