landscape.c
changeset 2951 2de6d3a59743
parent 2934 3f29a7212713
child 2952 58522ed8f0f1
equal deleted inserted replaced
2950:30eee9c93028 2951:2de6d3a59743
   173 	}
   173 	}
   174 
   174 
   175 	return z;
   175 	return z;
   176 }
   176 }
   177 
   177 
   178 uint GetSlopeZ(int x,  int y)
   178 uint GetSlopeZ(int x, int y)
   179 {
   179 {
   180 	TileInfo ti;
   180 	TileInfo ti;
   181 
   181 
   182 	FindLandscapeHeight(&ti, x, y);
   182 	FindLandscapeHeight(&ti, x, y);
   183 
   183 
   485 
   485 
   486 	x = r & MapMaxX();
   486 	x = r & MapMaxX();
   487 	y = (r >> MapLogX()) & MapMaxY();
   487 	y = (r >> MapLogX()) & MapMaxY();
   488 
   488 
   489 
   489 
   490 	if (x < 2 || y < 2)
   490 	if (x < 2 || y < 2) return;
   491 		return;
       
   492 
   491 
   493 	direction = GB(r, 22, 2);
   492 	direction = GB(r, 22, 2);
   494 	if (direction & 1) {
   493 	if (direction & 1) {
   495 		w = template->height;
   494 		w = template->height;
   496 		h = template->width;
   495 		h = template->width;
   522 				if (xw < yw + bias) return;
   521 				if (xw < yw + bias) return;
   523 				break;
   522 				break;
   524 		}
   523 		}
   525 	}
   524 	}
   526 
   525 
   527 	if (x + w >= MapMaxX() - 1)
   526 	if (x + w >= MapMaxX() - 1) return;
   528 		return;
   527 	if (y + h >= MapMaxY() - 1) return;
   529 
       
   530 	if (y + h >= MapMaxY() - 1)
       
   531 		return;
       
   532 
   528 
   533 	tile = &_m[TileXY(x, y)];
   529 	tile = &_m[TileXY(x, y)];
   534 
   530 
   535 	switch (direction) {
   531 	switch (direction) {
   536 		case 0:
   532 		case 0: