diff mm7_2.cpp @ 767:45615cacad31

Fog fixed
author Nomad
date Sat, 23 Mar 2013 21:11:15 +0200
parents cf2fbac6edc9
children 7994986603d5 a821bbace194
line wrap: on
line diff
--- a/mm7_2.cpp	Sat Mar 23 20:22:51 2013 +0200
+++ b/mm7_2.cpp	Sat Mar 23 21:11:15 2013 +0200
@@ -6741,25 +6741,15 @@
 
 
 //----- (004547A3) --------------------------------------------------------
-unsigned int MapStats::GetMapInfo(const char *Str2)
-{
-  MapStats *v2; // esi@1
-  unsigned int v3; // edi@1
-  const char **v4; // ebx@2
-  unsigned int result; // eax@6
-
-  v3 = 1;
-  if ( (signed int)uNumMaps <= 1 )
-     return 0;
-  
-    while ( !*this->pInfos[v3].pFilename || _strcmpi(this->pInfos[v3].pFilename, Str2) )
-    {
-      ++v3;
-      if ( (signed int)v3 >= (signed int)uNumMaps )
-        return 0;
-    }
-    return v3;
-
+MAP_TYPE MapStats::GetMapInfo(const char *Str2)
+{
+  assert(uNumMaps >= 2);
+
+  for (uint i = 1; i < uNumMaps; ++i)
+    if (!strcmpi(pInfos[i].pFilename, Str2))
+      return (MAP_TYPE)i;
+
+  assert(false && "Map not found!");
 }
 
 //----- (004547E4) --------------------------------------------------------