Height_amsl function

hi everyone,
I try to analyze some of my simulation log and I look into TerrH data. I have .dat file for my flight area but sometimes my TerrH value goes 0. I check .dat file with script that visualize .dat file to .jpeg. When I saw that .jpeg file my flight area has some altitude but height_amsl function return 0. Have you ever been in this situations before ?

my autopilot version is 4.0.6 but i use https://terrain.ardupilot.org/ site for generate .dat file i just saw “Compatible with Ardupilot 4.1+” note. Maybe this was the problem. I try to implement 4.1.0 Terrain lib to my version. Do you think is there any conflict with this implementation?

I would recommend updating to the current version of Ardupilot, there was a lot of stuff fixed and upgraded since 4.0.1.