From a460298a1297a7fe02183ade2e614b20753ca521 Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Sun, 1 Aug 2021 21:47:48 +0200 Subject: [PATCH] fixed division by 0 error --- scripts/minimap/obj_to_png.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/minimap/obj_to_png.py b/scripts/minimap/obj_to_png.py index 2967b9e..6daaf9f 100644 --- a/scripts/minimap/obj_to_png.py +++ b/scripts/minimap/obj_to_png.py @@ -71,7 +71,9 @@ def draw_model(scene_scale, scene_trans, scene): for face in mesh.faces: for vertex_i in face: height = scene.vertices[vertex_i][color_axe] - color = (height - min_height) / max_height + color = 1 + if max_height != 0: + color = (height - min_height) / max_height glColor3f(color, color, color) glVertex3f(*scene.vertices[vertex_i])