From 8a11b6b31d253b3d54daa8afadf92b4073c5f127 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Fri, 20 Jan 2012 06:32:28 +0800 Subject: [PATCH] Check coordinates of signs before using them to read pmap or pressure --- src/graphics.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/graphics.c b/src/graphics.c index aa72139b7..c460725ab 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -3056,15 +3056,18 @@ void render_signs(pixel *vid_buf) //Displaying special information if (strcmp(signs[i].text, "{p}")==0) { - sprintf(buff, "Pressure: %3.2f", pv[signs[i].y/CELL][signs[i].x/CELL]); //...pressure + float pressure = 0.0f; + if (signs[i].x>=0 && signs[i].x=0 && signs[i].y>8].temp-273.15); //...tempirature + if (signs[i].x>=0 && signs[i].x=0 && signs[i].y>8].temp-273.15); //...temperature else - sprintf(buff, "Temp: 0.00"); //...tempirature + sprintf(buff, "Temp: 0.00"); //...temperature drawtext(vid_buf, x+3, y+3, buff, 255, 255, 255, 255); }