summaryrefslogtreecommitdiff
path: root/src/powder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/powder.c')
-rw-r--r--src/powder.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/powder.c b/src/powder.c
index fca05a4..11e1b14 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -496,7 +496,7 @@ inline int create_part(int p, int x, int y, int t)
(pmap[y][x]&0xFF)!=PT_BRMT &&
(pmap[y][x]&0xFF)!=PT_NBLE &&
(pmap[y][x]&0xFF)!=PT_IRON &&
- (pmap[y][x]&0xFF)!=PT_INST &&
+ (pmap[y][x]&0xFF)!=PT_INST &&
(pmap[y][x]&0xFF)!=PT_INWR)
return -1;
if(parts[pmap[y][x]>>8].life!=0)
@@ -1015,7 +1015,7 @@ void update_particles_i(pixel *vid, int start, int inc)
int starti = (start*-1);
if(sys_pause&&!framerender)
return;
- if(ISGRAV==1)
+ if(ISGRAV==1)
{
ISGRAV = 0;
GRAV ++;
@@ -1266,11 +1266,16 @@ void update_particles_i(pixel *vid, int start, int inc)
for(i=start; i<(NPART-starti); i+=inc)
if(parts[i].type)
{
- //printf("parts[%d].type: %d\n", i, parts[i].type);
-
- lx = parts[i].x;
+ lx = parts[i].x;
ly = parts[i].y;
t = parts[i].type;
+ if (ptypes[t].update_func)
+ {
+ if (ptypes[t].update_func (i))
+ goto killed;
+ }
+ //printf("parts[%d].type: %d\n", i, parts[i].type);
+
if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_STKM2 && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL && t!=PT_SPNG && t!=PT_DEUT)
{
@@ -2001,7 +2006,7 @@ void update_particles_i(pixel *vid, int start, int inc)
} else if(parts[r>>8].type==PT_BRAY&&parts[r>>8].tmp==1){
parts[r>>8].life = 1020;
//docontinue = 1;
- } else {
+ } else if(parts[r>>8].type!=PT_INWR && parts[r>>8].type!=PT_ARAY) {
if(nyy!=0 || nxx!=0){
create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK);
}
@@ -2129,7 +2134,7 @@ void update_particles_i(pixel *vid, int start, int inc)
{
t = parts[i].type = PT_PLNT;
parts[r>>8].type = PT_PLNT;
- parts[r>>8].life = 0;
+ parts[r>>8].life = 0;
}
else if((r&0xFF)==PT_LAVA && 1>(rand()%250))
{
@@ -3055,10 +3060,10 @@ void update_particles_i(pixel *vid, int start, int inc)
else if(t==PT_PRTI)
{
int temprange = 100;
+ int count =0;
for( temp = 0; temp < MAX_TEMP; temp += temprange)
if(parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
parts[i].tmp = temp/100;
- int count =0;
for(ny=-1; ny<2; ny++)
for(nx=-1; nx<2; nx++)
if(x+nx>=0 && y+ny>0 &&
@@ -3085,10 +3090,10 @@ void update_particles_i(pixel *vid, int start, int inc)
else if(t==PT_PRTO)
{
int temprange = 100;
+ int count = 0;
for( temp = 0; temp < MAX_TEMP; temp += temprange)
if(parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
parts[i].tmp = temp/100;
- int count = 0;
for(ny=1; ny>-2; ny--)
for(nx=1; nx>-2; nx--)
if(x+nx>=0 && y+ny>0 &&