summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2010-08-12 19:10:59 (GMT)
committer Simon <simon@hardwired.org.uk>2010-08-12 19:10:59 (GMT)
commit1a629e91004f504098c8f30733b18d9c8f2f2b75 (patch)
tree4431f0f29997f5bdfa14910a7310e2b8480028e4
parentc93561a2e5c4f04aef524e4e846474a379b46321 (diff)
downloadpowder-1a629e91004f504098c8f30733b18d9c8f2f2b75.zip
powder-1a629e91004f504098c8f30733b18d9c8f2f2b75.tar.gz
Switch fix
-rwxr-xr-xpowder.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/powder.c b/powder.c
index 90b11be..a09af36 100755
--- a/powder.c
+++ b/powder.c
@@ -1823,6 +1823,11 @@ void update_particles_i(pixel *vid, int start, int inc){
}
}
if(t==PT_FIRE || t==PT_PLSM || t==PT_LAVA || t==PT_SPRK || fe || (t==PT_PHOT&&(1>rand()%10)) || t ==PT_SWCH) {
+ 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(ny=-2; ny<3; ny++)
if(x+nx>=0 && y+ny>0 &&
@@ -1891,8 +1896,6 @@ void update_particles_i(pixel *vid, int start, int inc){
}
}
if(rt==PT_SWCH && t==PT_SPRK){
- if(parts[r>>8].life<10&&parts[r>>8].life>0)
- parts[r>>8].life--;
pavg = parts_avg(r>>8, i);
if(parts[i].ctype == PT_PSCN&&pavg != PT_INSL)
parts[r>>8].life = 10;
@@ -1905,17 +1908,6 @@ void update_particles_i(pixel *vid, int start, int inc){
}
}
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;
- }
- }
-
- }
- pavg = parts_avg(i, r>>8);
if(pavg != PT_INSL){
if(t==PT_SPRK && (rt==PT_WIRE||rt==PT_ETRD||rt==PT_BMTL||rt==PT_BRMT||rt==PT_LRBD||rt==PT_RBDM||rt==PT_PSCN||rt==PT_NSCN||rt==PT_NBLE) && parts[r>>8].life==0 &&
(parts[i].life<3 || ((r>>8)<i && parts[i].life<4)) && abs(nx)+abs(ny)<4) {
@@ -1977,7 +1969,7 @@ void update_particles_i(pixel *vid, int start, int inc){
if(t==PT_SPRK&&parts[i].ctype==PT_SWCH&&parts[i].life<=1)
{
parts[i].type = PT_SWCH;
- parts[i].life = 10;
+ parts[i].life = 11;
}
}
}