diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-07-12 13:51:47 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-07-12 13:51:47 (GMT) |
| commit | aaaed342efc57e4c94aebac85b3c50f6ee0725de (patch) | |
| tree | e60d6d276a1870855e3ad08e25626b3016881335 /src | |
| parent | 1be79e581d31f1c40051f916128ecbce64f80022 (diff) | |
| download | powder-aaaed342efc57e4c94aebac85b3c50f6ee0725de.zip powder-aaaed342efc57e4c94aebac85b3c50f6ee0725de.tar.gz | |
Fix cursor rendering and some potential crashes for LIFE, courtesy of jacksonmj
Diffstat (limited to 'src')
| -rw-r--r-- | src/graphics.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/graphics.c b/src/graphics.c index ecc6b4a..9dd10dd 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2077,7 +2077,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx, ny, cr, cg, cb, 255); } - else if (t==PT_LIFE && parts[i].ctype < NGOLALT) { + else if (t==PT_LIFE && parts[i].ctype>=0 && parts[i].ctype < NGOLALT) { if (parts[i].ctype==NGT_LOTE)//colors for life states { if (parts[i].tmp==2) @@ -4214,7 +4214,7 @@ corrupt: void render_cursor(pixel *vid, int x, int y, int t, int rx, int ry) { int i,j,c; - if (t<PT_NUM||t==SPC_AIR||t==SPC_HEAT||t==SPC_COOL||t==SPC_VACUUM||t==SPC_WIND) + if (t<PT_NUM||(t&0xFF)==PT_LIFE||t==SPC_AIR||t==SPC_HEAT||t==SPC_COOL||t==SPC_VACUUM||t==SPC_WIND) { if (rx<=0) xor_pixel(x, y, vid); |
