diff Outdoor.cpp @ 179:f102bbff6fd8

15.02.13 Water
author Ritor1
date Fri, 15 Feb 2013 17:14:24 +0600
parents 49e74dee4eab
children 16d257ffc802
line wrap: on
line diff
--- a/Outdoor.cpp	Fri Feb 15 10:41:54 2013 +0600
+++ b/Outdoor.cpp	Fri Feb 15 17:14:24 2013 +0600
@@ -2432,7 +2432,7 @@
  if (v3 < 198)
  {
   if (v3 >= 90)
-    v3 = v3 + this->pTileTypes[(v3 - 90) / 18].uTileID - 36 * (v3 - 90) / 36 - 90;
+    v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * (v3 - 90) / 36 - 90;
  }
  else
    v3 = v3 + this->pTileTypes[3].uTileID - 198;
@@ -2470,13 +2470,13 @@
     result = pTileTable->pTiles[v3].uAttributes;
   }
   return result;*/
-   if (uX > 127 || uY > 127)
-   return 0;
- else
- {
-  v3 = this->pTerrain.pTilemap[128 * uY + uX];
-  if ( v3 >= 90 )
-     v3 = v3 + this->pTileTypes[(v3 - 90) / 18].uTileID - 36 * (v3 - 90) / 36 - 90;
+  if (uX > 127 || uY > 127)
+    return 0;
+  else
+  {
+    v3 = this->pTerrain.pTilemap[uY * 128 + uX];
+    if ( v3 >= 90 )
+      v3 = v3 + this->pTileTypes[(v3 - 90) / 36].uTileID - 36 * (v3 - 90) / 36 - 90;
   return pTileTable->pTiles[v3].uAttributes;
  }
 }
@@ -2489,7 +2489,7 @@
   if ( (signed int)uX < 0 || (signed int)uX > 127 || (signed int)uZ < 0 || (signed int)uZ > 127 )
     result = 0;
   else
-    result = 32 * *(&this->pTerrain.pHeightmap[128 * uZ] + uX);
+    result = 32 * *(&this->pTerrain.pHeightmap[uZ * 128 + uX]);
   return result;
 }