src/tree_cmd.cpp
branchnoai
changeset 9694 e72987579514
parent 9629 66dde6412125
child 9701 d1ac22c62f64
--- a/src/tree_cmd.cpp	Fri Aug 03 19:16:36 2007 +0000
+++ b/src/tree_cmd.cpp	Fri Aug 03 22:09:42 2007 +0000
@@ -374,13 +374,8 @@
 		i = GetTreeCount(ti->tile) + 1;
 		do {
 			SpriteID image = s[0].sprite + (--i == 0 ? GetTreeGrowth(ti->tile) : 3);
-			SpriteID pal;
-			if (HASBIT(_transparent_opt, TO_TREES)) {
-				SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
-				pal = PALETTE_TO_TRANSPARENT;
-			} else {
-				pal = s[0].pal;
-			}
+			SpriteID pal = s[0].pal;
+
 			te[i].image = image;
 			te[i].pal   = pal;
 			te[i].x = d->x;
@@ -404,7 +399,7 @@
 
 			if (tep == NULL) break;
 
-			AddSortableSpriteToDraw(tep->image, tep->pal, ti->x + tep->x, ti->y + tep->y, 5, 5, 0x10, z);
+			AddSortableSpriteToDraw(tep->image, tep->pal, ti->x + tep->x, ti->y + tep->y, 5, 5, 0x10, z, HASBIT(_transparent_opt, TO_TREES));
 			tep->image = 0;
 		}
 	}
@@ -421,9 +416,9 @@
 	return z + GetPartialZ(x & 0xF, y & 0xF, tileh);
 }
 
-static Slope GetSlopeTileh_Trees(TileIndex tile, Slope tileh)
+static Foundation GetFoundation_Trees(TileIndex tile, Slope tileh)
 {
-	return tileh;
+	return FOUNDATION_NONE;
 }
 
 static CommandCost ClearTile_Trees(TileIndex tile, byte flags)
@@ -560,7 +555,7 @@
 					case 2: { /* add a neighbouring tree */
 						TreeType treetype = GetTreeType(tile);
 
-						tile += TileOffsByDir(Random() & 7);
+						tile += TileOffsByDir((Direction)(Random() & 7));
 
 						if (!IsTileType(tile, MP_CLEAR) || IsBridgeAbove(tile)) return;
 
@@ -675,5 +670,5 @@
 	ChangeTileOwner_Trees,    /* change_tile_owner_clear */
 	NULL,                     /* get_produced_cargo_proc */
 	NULL,                     /* vehicle_enter_tile_proc */
-	GetSlopeTileh_Trees,      /* get_slope_tileh_proc */
+	GetFoundation_Trees,      /* get_foundation_proc */
 };