summaryrefslogtreecommitdiff
path: root/src/elements/wire.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-17 16:14:23 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-17 16:14:23 (GMT)
commitca1690efe14d5cbb1637e9114403afffc3f75984 (patch)
tree013bacc68a395bb1b24ca39622febedcb236faf8 /src/elements/wire.cpp
parent75f62127518895ae9acddfd2644a67ab8796253c (diff)
downloadpowder-ca1690efe14d5cbb1637e9114403afffc3f75984.zip
powder-ca1690efe14d5cbb1637e9114403afffc3f75984.tar.gz
TPT: Separate loop for updating life, and add SPRK life checks to most electronics 6bdc05cc40
Diffstat (limited to 'src/elements/wire.cpp')
-rw-r--r--src/elements/wire.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/elements/wire.cpp b/src/elements/wire.cpp
index c3c918b..4e5d072 100644
--- a/src/elements/wire.cpp
+++ b/src/elements/wire.cpp
@@ -29,7 +29,12 @@ int update_WIRE(UPDATE_FUNC_ARGS) {
r = pmap[y+ry][x+rx];
if (!r)
continue;
- if((r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_PSCN){parts[i].ctype=1; parts[r>>8].life=0; return 0;}
+ if((r&0xFF)==PT_SPRK && parts[r>>8].life<4 && parts[r>>8].ctype==PT_PSCN)
+ {
+ parts[i].ctype=1;
+ parts[r>>8].life=0;
+ return 0;
+ }
else if((r&0xFF)==PT_NSCN && parts[i].tmp==1){sim->create_part(-1, x+rx, y+ry, PT_SPRK);}
else if((r&0xFF)==PT_WIRE && parts[r>>8].tmp==1 && !parts[i].tmp){count++;}
}