diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2011-07-06 09:08:13 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-07-06 09:44:56 (GMT) |
| commit | 11dbdb9314e4f1a4d60201ae5b2d6a5f6f7fc310 (patch) | |
| tree | b16618d039d49815569cea3e8a446f3d869dfe2f /src/main.c | |
| parent | 8754bb0bf6effef6ff11d23e5087f4b6ef618496 (diff) | |
| download | powder-11dbdb9314e4f1a4d60201ae5b2d6a5f6f7fc310.zip powder-11dbdb9314e4f1a4d60201ae5b2d6a5f6f7fc310.tar.gz | |
Fix crashing when pipe has a negative tmp value
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2553,13 +2553,13 @@ int main(int argc, char *argv[]) if (DEBUG_MODE) { int tctype = parts[cr>>8].ctype; - if (tctype>=PT_NUM || tctype<0 || (cr&0xFF)==PT_PHOT) - tctype = 0; if ((cr&0xFF)==PT_PIPE) { if (parts[cr>>8].tmp<PT_NUM) tctype = parts[cr>>8].tmp; else tctype = 0; } + if (tctype>=PT_NUM || tctype<0 || (cr&0xFF)==PT_PHOT) + tctype = 0; sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); sprintf(coordtext, "#%d, X:%d Y:%d", cr>>8, x/sdl_scale, y/sdl_scale); } else { |
