diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2011-04-14 19:01:21 (GMT) |
|---|---|---|
| committer | Simon <simon@hardwired.org.uk> | 2011-04-16 16:26:54 (GMT) |
| commit | 1c771d1ea48f692b6c4a0b8ba83fbdf94590c527 (patch) | |
| tree | 197bca51a07b7155bd3f47cc0a460f5dc46db6cf /src/elements | |
| parent | 466a6b2ccbfb68a37d69843fcfac0c67bf980a78 (diff) | |
| download | powder-1c771d1ea48f692b6c4a0b8ba83fbdf94590c527.zip powder-1c771d1ea48f692b6c4a0b8ba83fbdf94590c527.tar.gz | |
Photons and neutrons through portal
Diffstat (limited to 'src/elements')
| -rw-r--r-- | src/elements/prti.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/elements/prti.c b/src/elements/prti.c index 30f86ae..d21bf56 100644 --- a/src/elements/prti.c +++ b/src/elements/prti.c @@ -23,22 +23,29 @@ int update_PRTI(UPDATE_FUNC_ARGS) { count ++; if (!r) fe = 1; - if ((r>>8)>=NPART || !r) + if ((r>>8)>=NPART) continue; - if ((r&0xFF)==PT_SPRK || ((r&0xFF)!=PT_PRTI && (r&0xFF)!=PT_PRTO && (ptypes[r&0xFF].falldown!= 0 || ptypes[r&0xFF].state == ST_GAS))) - for ( nnx=0; nnx<80; nnx++) - if (!portal[parts[i].tmp][count-1][nnx]) - { - portal[parts[i].tmp][count-1][nnx] = parts[r>>8].type; - portaltemp[parts[i].tmp][count-1][nnx] = parts[r>>8].temp; - portalctype[parts[i].tmp][count-1][nnx] = parts[r>>8].ctype; - if ((r&0xFF)==PT_SPRK) - part_change_type(r>>8,x+rx,y+ry,parts[r>>8].ctype); - else - kill_part(r>>8); - fe = 1; - break; - } + if (!r || (r&0xFF)==PT_PRTI || (r&0xFF)==PT_PRTO || (ptypes[r&0xFF].falldown== 0 && ptypes[r&0xFF].state != ST_GAS && (r&0xFF)!=PT_SPRK)) + { + r = photons[y+ry][x+rx]; + if ((r>>8)>=NPART) + continue; + if (!r || (r&0xFF)==PT_PRTI || (r&0xFF)==PT_PRTO || (ptypes[r&0xFF].falldown== 0 && ptypes[r&0xFF].state != ST_GAS && (r&0xFF)!=PT_SPRK)) + continue; + } + for ( nnx=0; nnx<80; nnx++) + if (!portal[parts[i].tmp][count-1][nnx]) + { + portal[parts[i].tmp][count-1][nnx] = parts[r>>8].type; + portaltemp[parts[i].tmp][count-1][nnx] = parts[r>>8].temp; + portalctype[parts[i].tmp][count-1][nnx] = parts[r>>8].ctype; + if ((r&0xFF)==PT_SPRK) + part_change_type(r>>8,x+rx,y+ry,parts[r>>8].ctype); + else + kill_part(r>>8); + fe = 1; + break; + } } |
