diff mm7_1.cpp @ 89:98cd93e14777

pointer fixes
author zipi
date Wed, 06 Feb 2013 21:19:42 +0000
parents 1faa29fd4c2d
children 2baff1256844
line wrap: on
line diff
--- a/mm7_1.cpp	Mon Feb 04 17:21:02 2013 +0600
+++ b/mm7_1.cpp	Wed Feb 06 21:19:42 2013 +0000
@@ -3695,7 +3695,7 @@
 //----- (0041F6C1) --------------------------------------------------------
 void __cdecl RestUI_Initialize()
 {
-  char *v0; // eax@10
+  Player *v0; // eax@10
 
   if ( !dword_506F14 )
     pAudioPlayer->StopChannels(-1, -1);
@@ -3718,16 +3718,16 @@
                                    pParty->vPosition.z);
   if ( sub_476387() )
   {
-    v0 = (char *)&pParty->pPlayers[0].uClass;
-    while ( *v0 != 31 )
-    {
-      v0 += 6972;
-      if ( (signed int)v0 >= (signed int)((char *)&pParty->pPickedItem.uExpireTime + 5) )
-        goto LABEL_15;
-    }
-    ++uRestUI_FoodRequiredToRest;
-  }
-LABEL_15:
+    v0 = pParty->pPlayers;//[0].uClass;
+	while ( v0 <= &pParty->pPlayers[3] )
+    {
+      ++v0;
+      if ( v0 > &pParty->pPlayers[3] )
+        break;
+    }
+	if(v0->uClass == 31)
+		++uRestUI_FoodRequiredToRest;
+  }
   if ( CheckHiredNPCSpeciality(0x1Du) )
     --uRestUI_FoodRequiredToRest;
   if ( CheckHiredNPCSpeciality(0x1Eu) )