Changeset - r14179:b84caa7472cc
[Not reviewed]
master
0 2 0
yexo - 15 years ago 2010-01-05 22:32:47
yexo@openttd.org
(svn r18738) -Fix (r18719): when a tree died while there was snow the amount of snow on the tile changed
2 files changed with 10 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/clear_map.h
Show inline comments
 
@@ -310,14 +310,14 @@ static inline void MakeField(TileIndex t
 
 * @param t the tile to make snowy
 
 * @pre GetClearGround(t) != CLEAR_SNOW
 
 */
 
static inline void MakeSnow(TileIndex t)
 
static inline void MakeSnow(TileIndex t, uint density = 0)
 
{
 
	assert(GetClearGround(t) != CLEAR_SNOW);
 
	SetBit(_m[t].m3, 4);
 
	if (GetClearGround(t) == CLEAR_FIELDS) {
 
		SetClearGroundDensity(t, CLEAR_GRASS, 0);
 
		SetClearGroundDensity(t, CLEAR_GRASS, density);
 
	} else {
 
		SetClearDensity(t, 0);
 
		SetClearDensity(t, density);
 
	}
 
}
 

	
src/tree_cmd.cpp
Show inline comments
 
@@ -702,16 +702,19 @@ static void TileLoop_Trees(TileIndex til
 
					case TREE_GROUND_SHORE: MakeShore(tile); break;
 
					case TREE_GROUND_GRASS: MakeClear(tile, CLEAR_GRASS, GetTreeDensity(tile)); break;
 
					case TREE_GROUND_ROUGH: MakeClear(tile, CLEAR_ROUGH, 3); break;
 
					case TREE_GROUND_ROUGH_SNOW:
 
					case TREE_GROUND_ROUGH_SNOW: {
 
						uint density = GetTreeDensity(tile);
 
						MakeClear(tile, CLEAR_ROUGH, 3);
 
						MakeSnow(tile);
 
						MakeSnow(tile, density);
 
						break;
 
					}
 
					default: // snow or desert
 
						if (_settings_game.game_creation.landscape == LT_TROPIC) {
 
							MakeClear(tile, CLEAR_DESERT, GetTreeDensity(tile));
 
						} else {
 
							MakeClear(tile, CLEAR_GRASS, GetTreeDensity(tile));
 
							MakeSnow(tile);
 
							uint density = GetTreeDensity(tile);
 
							MakeClear(tile, CLEAR_GRASS, 3);
 
							MakeSnow(tile, density);
 
						}
 
						break;
 
				}
0 comments (0 inline, 0 general)