summaryrefslogtreecommitdiff
path: root/src/elements/wire.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2012-02-04 01:34:22 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-02-05 14:45:30 (GMT)
commit68ab3ca3ca846ac5911cbfaa7c511b8f13108a54 (patch)
tree05de2af20a5756a2018532a26be65c1c4bb39f05 /src/elements/wire.c
parent1a5cd45eb8949fd8e81019337e4a92278e83d19b (diff)
downloadpowder-68ab3ca3ca846ac5911cbfaa7c511b8f13108a54.zip
powder-68ab3ca3ca846ac5911cbfaa7c511b8f13108a54.tar.gz
More SPRK life checks for electronic elements
Check life>0, because SPRK changes back to its ctype when life==0. This could result in SPRK being found/not found depending on particle order, so pretend SPRK is not there if life==0 (it will disappear during the current frame).
Diffstat (limited to 'src/elements/wire.c')
-rw-r--r--src/elements/wire.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/elements/wire.c b/src/elements/wire.c
index 2177ec7..2688e5a 100644
--- a/src/elements/wire.c
+++ b/src/elements/wire.c
@@ -29,10 +29,9 @@ int update_WIRE(UPDATE_FUNC_ARGS) {
r = pmap[y+ry][x+rx];
if (!r)
continue;
- if((r&0xFF)==PT_SPRK && parts[r>>8].life<4 && parts[r>>8].ctype==PT_PSCN)
+ if((r&0xFF)==PT_SPRK && parts[r>>8].life==3 && 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){create_part(-1, x+rx, y+ry, PT_SPRK);}