diff mm7_4.cpp @ 554:9caf59edb1ee

Cave and Temple load and even doesn't crash (for a while).
author Nomad
date Mon, 04 Mar 2013 22:44:41 +0200
parents 214d9d47cf1f
children fcbb3c281217
line wrap: on
line diff
--- a/mm7_4.cpp	Mon Mar 04 20:29:31 2013 +0200
+++ b/mm7_4.cpp	Mon Mar 04 22:44:41 2013 +0200
@@ -3210,7 +3210,7 @@
     if ( v7 == 0 )
       v7 = 1;
     if (pPlayer->expression == CHARACTER_EXPRESSION_21)
-      pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->field_1AA8, &pPlayer->field_1AA4, pMiscTimer->uTimeElapsed);
+      pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed);
     else
       pFrame = pPlayerFrameTable->GetFrameBy_x(v7, pPlayer->uExpressionTimePassed);
     if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || v22 )
@@ -4335,25 +4335,25 @@
 }
 
 //----- (00494B5E) --------------------------------------------------------
-PlayerFrame *PlayerFrameTable::GetFrameBy_y(int *a2, int *a3, int a4)
+PlayerFrame *PlayerFrameTable::GetFrameBy_y(int *pFramesetID, int *pAnimTime, int a4)
 {
   PlayerFrameTable *v4; // edi@1
   int v5; // esi@1
   int v6; // eax@2
 
   v4 = this;
-  v5 = a4 + *a3;
-  if ( v5 < 8 * this->pFrames[*a2].uAnimTime )
-  {
-    *a3 = v5;
+  v5 = a4 + *pAnimTime;
+  if ( v5 < 8 * this->pFrames[*pFramesetID].uAnimTime )
+  {
+    *pAnimTime = v5;
   }
   else
   {
     v6 = rand() % 4 + 21;
-    *a2 = v6;
-    *a3 = 8 * v5 % v4->pFrames[v6].uAnimTime;
-  }
-  return &v4->pFrames[*a2];
+    *pFramesetID = v6;
+    *pAnimTime = 8 * v5 % v4->pFrames[v6].uAnimTime;
+  }
+  return &v4->pFrames[*pFramesetID];
 }
 
 //----- (00494BC3) --------------------------------------------------------