summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c16
-rw-r--r--src/powder.c6
2 files changed, 13 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 77cd7e6..46267c2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -492,6 +492,10 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
memset(vx, 0, sizeof(vx));
memset(vy, 0, sizeof(vy));
memset(pv, 0, sizeof(pv));
+ memset(photons, 0, sizeof(photons));
+ memset(wireless, 0, sizeof(wireless));
+ memset(gol2, 0, sizeof(gol2));
+ memset(portal, 0, sizeof(portal));
death = death2 = ISSPAWN1 = ISSPAWN2 = 0;
}
@@ -714,10 +718,10 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
ttv |= (d[p++]);
parts[i-1].tmp = ttv;
if(ptypes[parts[i-1].type].properties&PROP_LIFE && !parts[i-1].tmp)
- for(q = 1; q<NGOL ; q++){
- if(parts[i-1].type==goltype[q-1] && grule[q][9]==2)
- parts[i-1].tmp = grule[q][9]-1;
- }
+ for(q = 1; q<NGOL ; q++) {
+ if(parts[i-1].type==goltype[q-1] && grule[q][9]==2)
+ parts[i-1].tmp = grule[q][9]-1;
+ }
} else {
p+=2;
}
@@ -1503,7 +1507,7 @@ int main(int argc, char *argv[])
parts[i].type = parts[i].ctype;
parts[i].life = 0;
}
- }
+ }
else
{
for (nx = 0; nx<XRES/CELL; nx++)
@@ -1737,7 +1741,7 @@ int main(int argc, char *argv[])
int tctype = parts[cr>>8].ctype;
if (tctype>=PT_NUM)
tctype = 0;
- sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d, Tmp: %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 ,parts[cr>>8].tmp);
+ 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(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[parts[cr>>8].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life);
} else {
sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f);
diff --git a/src/powder.c b/src/powder.c
index 873913c..b2932d1 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -664,9 +664,9 @@ inline int create_part(int p, int x, int y, int t)
parts[i].life = 50;
parts[i].tmp = 50;
}
- if(ptypes[t].properties&PROP_LIFE) {
+ if (ptypes[t].properties&PROP_LIFE) {
int r;
- for(r = 0;r<NGOL;r++)
+ for(r = 0; r<NGOL; r++)
if(t==goltype[r])
parts[i].tmp = grule[r+1][9] - 1;
}
@@ -1317,7 +1317,7 @@ void update_particles_i(pixel *vid, int start, int inc)
} else {
parts[r>>8].tmp --;
if(parts[r>>8].tmp<=0)
- parts[r>>8].type = PT_NONE;//using kill_part makes it not work
+ parts[r>>8].type = PT_NONE;//using kill_part makes it not work
}
}
}