Example #1
0
float MapTerrain2::GetLiquidHeight(float x, float y, float z)
{
	GridMap *g = GetGrid(x, y);
	if( g )
	{
		float level = g->getLiquidLevel( x, y );
		if( level != INVALID_HEIGHT )
			return level;
	}
	return VMAP_VALUE_NOT_INITIALIZED;
}
Example #2
0
uint8 MapTerrain2::GetLiquidFlags(float x, float y, float z)
{
	GridMap *g = GetGrid(x, y);
	if( g )
	{
		//check if we are above the liquid level (standing on bridge or flying) to avoid environmental dmg
		float level = g->getLiquidLevel( x, y );
		if( level == INVALID_HEIGHT )
			return 0;
		//seems like we are below (inside) liquid
		return g->getTerrainType( x, y );
	}
	return 0;
}