TheAssemblyArmada / Thyme

An open source re-implementation of Generals : Zero Hour written in C++.
GNU General Public License v2.0
585 stars 59 forks source link

null test missing in W3DTerrainVisual::Set_Raw_Map_Height #1052

Open xezon opened 10 months ago

xezon commented 10 months ago
void W3DTerrainVisual::Set_Raw_Map_Height(const ICoord2D *pos, int height)
{
    if (m_heightMap != nullptr) {
        int x = m_heightMap->Get_Border_Size() + pos->x;
        int y = m_heightMap->Get_Border_Size() + pos->y;
        int map_height = m_heightMap->Get_Height(x, y);

        if (map_height > height) {
            m_heightMap->Set_Height(x, y, height);
            m_baseHeightMap->Static_Lighting_Changed();
        }
    }
}

Never tests m_baseHeightMap. But does so in other functions. Problem?