diff mm7_4.cpp @ 1413:3881d2f94eb1

UseNPCSkill DIALOGUE_USE_NPC_ABILITY
author Nomad
date Sat, 27 Jul 2013 16:09:00 +0200
parents 2423bc2af692
children 9a1adf08f4ed
line wrap: on
line diff
--- a/mm7_4.cpp	Sat Jul 27 14:28:14 2013 +0200
+++ b/mm7_4.cpp	Sat Jul 27 16:09:00 2013 +0200
@@ -530,15 +530,8 @@
 //----- (00487DA9) --------------------------------------------------------
 void __cdecl sub_487DA9()
 {
-  char *v0; // eax@1
-
-  v0 = &array_77EC08[0].field_108;
-  do
-  {
-    *v0 = 0;
-    v0 += 268;
-  }
-  while ( (signed int)v0 < (signed int)&pVerticesSR_801A10[4] );
+  for (int i = 0; i < 20000; ++i)
+    array_77EC08[i].field_108 = 0;
 }
 
 //----- (00487DBE) --------------------------------------------------------
@@ -585,9 +578,9 @@
     v = v_replace;
   HSV2RGB(&r, &g, &b, h, s, v);
 
-  return (((uint)floorf(r * 255.0f + 0.5f) & 0xFF) << 16) |
-         (((uint)floorf(g * 255.0f + 0.5f) & 0xFF) << 8) |
-         ((uint)floorf(b * 255.0f + 0.5f) & 0xFF);
+  return (((uint)round(r * 255.0f) & 0xFF) << 16) |
+         (((uint)round(g * 255.0f) & 0xFF) << 8) |
+         (((uint)round(b * 255.0f) & 0xFF));
 }
 
 //----- (0048B561) --------------------------------------------------------
@@ -3735,19 +3728,17 @@
 		ArenaFight();
 		return;
 	}
-	else if(newDialogueType == DIALOGUE_9)
+	else if(newDialogueType == DIALOGUE_USE_NPC_ABILITY)
 	{
-		if ( !sub_4BB756(speakingNPC->uProfession) )
+		if (UseNPCSkill((NPCProf)speakingNPC->uProfession) == 0)
 		{
-			if ( speakingNPC->uProfession != 41 )
+			if ( speakingNPC->uProfession != GateMaster )
 				speakingNPC->bHasUsedTheAbility = 1;
 
 			pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
 		}
 		else
-		{
-			ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2u); //"Your packs are already full!"
-		}
+			ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2); //"Your packs are already full!"
 	}
 	else if(newDialogueType == DIALOGUE_13)
 	{