diff mm7_3.cpp @ 26:93bf1d5f6a6d

Game loading.
author Nomad
date Tue, 16 Oct 2012 00:05:53 +0200
parents 509744251c8e
children be2066176d89
line wrap: on
line diff
--- a/mm7_3.cpp	Mon Oct 15 18:45:11 2012 +0200
+++ b/mm7_3.cpp	Tue Oct 16 00:05:53 2012 +0200
@@ -6303,27 +6303,12 @@
 //----- (00476C60) --------------------------------------------------------
 void NPCStats::_476C60()
 {
-  signed int v1; // esi@1
-  NPCData *v2; // edx@2
-  char **v3; // eax@2
-
-  v1 = 1;
-  if ( (signed int)this->uNumNewNPCs > 1 )
-  {
-    v2 = &this->pNewNPCData[1];
-    v3 = this->pNPCNames2;
-    do
-    {
-      ++v1;
-      v2->pName = *v3;
-      ++v3;
-      ++v2;
-    }
-    while ( v1 < (signed int)this->uNumNewNPCs );
-  }
-  if ( pParty->pHirelings[0].pName )
+  for (uint i = 1; i < uNumNewNPCs; ++i)
+    pNewNPCData[i].pName = pNPCNames2[i - 1];
+
+  if (pParty->pHirelings[0].pName)
     pParty->pHirelings[0].pName = pParty->pHireling1Name;
-  if ( pParty->pHirelings[1].pName )
+  if (pParty->pHirelings[1].pName)
     pParty->pHirelings[1].pName = pParty->pHireling2Name;
 }
 
@@ -20508,19 +20493,19 @@
 }
 
 //----- (00449B7E) --------------------------------------------------------
-char *__fastcall _449B7E_toggle_bit(char *pArray, __int16 a2, unsigned __int16 bToggle)
+unsigned char *_449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle)
 {
   signed int v3; // esi@1
-  char *result; // eax@1
+  unsigned char *result; // eax@1
   unsigned int v5; // edx@1
 
   v3 = a2 - 1;
-  result = &pArray[(signed __int16)(v3 >> 3)];
-  v5 = 0x80u >> v3 % 8;
+  result = &pArray[v3 / 8];
+  v5 = 0x80 >> v3 % 8;
   if ( bToggle )
     *result |= v5;
   else
-    *result &= ~(char)v5;
+    *result &= ~(unsigned char)v5;
   return result;
 }