Version 41.3, bug fixes for Insl and Swch
This commit is contained in:
parent
04d6a8051b
commit
08f98b5f6a
58
powder.c
Normal file → Executable file
58
powder.c
Normal file → Executable file
@ -2086,7 +2086,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
|||||||
for(nx=-2; nx<3; nx++)
|
for(nx=-2; nx<3; nx++)
|
||||||
for(ny=-2; ny<3; ny++)
|
for(ny=-2; ny<3; ny++)
|
||||||
if(x+nx>=0 && y+ny>0 &&
|
if(x+nx>=0 && y+ny>0 &&
|
||||||
x+nx<XRES && y+ny<YRES && (nx || ny))
|
x+nx<XRES && y+ny<YRES && (nx || ny))
|
||||||
{
|
{
|
||||||
r = pmap[y+ny][x+nx];
|
r = pmap[y+ny][x+nx];
|
||||||
if((r>>8)>=NPART || !r)
|
if((r>>8)>=NPART || !r)
|
||||||
@ -2102,14 +2102,38 @@ void update_particles_i(pixel *vid, int start, int inc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}else if(t==PT_SWCH)
|
||||||
if(t==PT_FIRE || t==PT_PLSM || t==PT_LAVA || t==PT_SPRK || fe || (t==PT_PHOT&&(1>rand()%10)) || t ==PT_SWCH)
|
{
|
||||||
|
rt = 3 + (int)pv[y/CELL][x/CELL];
|
||||||
|
for(nx=-2; nx<3; nx++)
|
||||||
|
for(ny=-2; ny<3; ny++)
|
||||||
|
if(x+nx>=0 && y+ny>0 &&
|
||||||
|
x+nx<XRES && y+ny<YRES && (nx || ny))
|
||||||
|
{
|
||||||
|
r = pmap[y+ny][x+nx];
|
||||||
|
if((r>>8)>=NPART || !r)
|
||||||
|
continue;
|
||||||
|
rt = parts[r>>8].type;
|
||||||
|
if(parts[r>>8].type == PT_SWCH&&parts_avg(i,r>>8)!=PT_INSL)
|
||||||
|
{
|
||||||
|
if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0)
|
||||||
|
{
|
||||||
|
parts[i].life = 9;
|
||||||
|
}
|
||||||
|
else if(parts[i].life==0&&parts[r>>8].life==10)
|
||||||
|
{
|
||||||
|
parts[i].life = 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(t==PT_SWCH)
|
||||||
|
if((parts[i].life>0&&parts[i].life<10)|| parts[i].life == 11)
|
||||||
|
{
|
||||||
|
parts[i].life--;
|
||||||
|
}
|
||||||
|
if(t==PT_FIRE || t==PT_PLSM || t==PT_LAVA || t==PT_SPRK || fe || (t==PT_PHOT&&(1>rand()%10)))
|
||||||
{
|
{
|
||||||
if(t==PT_SWCH)
|
|
||||||
if((parts[i].life>0&&parts[i].life<10)|| parts[i].life == 11)
|
|
||||||
{
|
|
||||||
parts[i].life--;
|
|
||||||
}
|
|
||||||
for(nx=-2; nx<3; nx++)
|
for(nx=-2; nx<3; nx++)
|
||||||
for(ny=-2; ny<3; ny++)
|
for(ny=-2; ny<3; ny++)
|
||||||
if(x+nx>=0 && y+ny>0 &&
|
if(x+nx>=0 && y+ny>0 &&
|
||||||
@ -2121,8 +2145,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
|||||||
if(bmap[(y+ny)/CELL][(x+nx)/CELL] && bmap[(y+ny)/CELL][(x+nx)/CELL]!=5)
|
if(bmap[(y+ny)/CELL][(x+nx)/CELL] && bmap[(y+ny)/CELL][(x+nx)/CELL]!=5)
|
||||||
continue;
|
continue;
|
||||||
rt = parts[r>>8].type;
|
rt = parts[r>>8].type;
|
||||||
if((a || ptypes[rt].explosive) && ((rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL) || t!=PT_SPRK) &&
|
if((a || ptypes[rt].explosive) && ((rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL && rt!=PT_SWCH) || t!=PT_SPRK) &&
|
||||||
(t!=PT_LAVA || parts[i].life>0 || (rt!=PT_METL && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_HSCN && rt!=PT_CSCN && rt!=PT_WIRE && rt!=PT_ETRD && rt!=PT_BMTL && rt!=PT_BRMT)) &&
|
(t!=PT_LAVA || parts[i].life>0 || (rt!=PT_METL && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_HSCN && rt!=PT_CSCN && rt!=PT_WIRE && rt!=PT_ETRD && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SWCH)) &&
|
||||||
ptypes[rt].flammable && (ptypes[rt].flammable + (int)(pv[(y+ny)/CELL][(x+nx)/CELL]*10.0f))>(rand()%1000))
|
ptypes[rt].flammable && (ptypes[rt].flammable + (int)(pv[(y+ny)/CELL][(x+nx)/CELL]*10.0f))>(rand()%1000))
|
||||||
{
|
{
|
||||||
parts[r>>8].type = PT_FIRE;
|
parts[r>>8].type = PT_FIRE;
|
||||||
@ -2191,20 +2215,6 @@ void update_particles_i(pixel *vid, int start, int inc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
pavg = parts_avg(i, r>>8);
|
pavg = parts_avg(i, r>>8);
|
||||||
if(t==PT_SWCH&&pavg!= PT_INSL)
|
|
||||||
{
|
|
||||||
if(parts[r>>8].type == PT_SWCH)
|
|
||||||
{
|
|
||||||
if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0)
|
|
||||||
{
|
|
||||||
parts[i].life = 9;
|
|
||||||
}
|
|
||||||
else if(parts[i].life==0&&parts[r>>8].life==10)
|
|
||||||
{
|
|
||||||
parts[i].life = 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(rt==PT_SWCH && t==PT_SPRK)
|
if(rt==PT_SWCH && t==PT_SPRK)
|
||||||
{
|
{
|
||||||
pavg = parts_avg(r>>8, i);
|
pavg = parts_avg(r>>8, i);
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
|
||||||
#define SAVE_VERSION 41
|
#define SAVE_VERSION 41
|
||||||
#define MINOR_VERSION 0
|
#define MINOR_VERSION 3
|
||||||
#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter.
|
#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter.
|
||||||
|
|
||||||
#define MENUV3
|
#define MENUV3
|
||||||
|
Reference in New Issue
Block a user