From 8754bb0bf6effef6ff11d23e5087f4b6ef618496 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Wed, 6 Jul 2011 08:15:11 +0800 Subject: [PATCH] Crashes when drawing stickman at the edge of the screen --- src/graphics.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/graphics.c b/src/graphics.c index 00616a539..8bdd6fa97 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1496,7 +1496,8 @@ void draw_line(pixel *vid, int x1, int y1, int x2, int y2, int r, int g, int b, e = (dy<<2)-dx; for (i=0; i<=dx; i++) { - vid[x+y*a] =PIXRGB(r, g, b); + if (x>=0 && y>=0 && x=0) { if (check==1) @@ -1701,7 +1702,7 @@ void draw_parts(pixel *vid) if (cmode!=CM_HEAT) { - if (t==PT_STKM) //Just draw head here + if (t==PT_STKM) { char buff[20]; //Buffer for HP pixel pc; @@ -1714,14 +1715,13 @@ void draw_parts(pixel *vid) if ((int)player[2]