Minimap: fixed negative-to-unsigned map size calculation

This commit is contained in:
Charles Dang 2022-06-05 16:28:14 -04:00 committed by Tommy
parent a79ea921f5
commit a6ae7c8f3b

View File

@ -315,8 +315,8 @@ void render_minimap(unsigned dst_w,
DBG_DP << "Creating minimap: " << static_cast<int>(map.w() * scale * 0.75) << ", " << map.h() * scale << std::endl;
const std::size_t map_width = map.w() * scale * 3 / 4;
const std::size_t map_height = map.h() * scale;
const std::size_t map_width = std::max(0, map.w()) * scale * 3 / 4;
const std::size_t map_height = std::max(0, map.h()) * scale;
// Gets a destination rect for drawing at the given coordinates.
// We need a balanced shift up and down of the hexes.