diff options
Diffstat (limited to 'src/simulation/elements/PRTI.cpp')
| -rw-r--r-- | src/simulation/elements/PRTI.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/simulation/elements/PRTI.cpp b/src/simulation/elements/PRTI.cpp index 23def7b..fc48325 100644 --- a/src/simulation/elements/PRTI.cpp +++ b/src/simulation/elements/PRTI.cpp @@ -66,36 +66,36 @@ int Element_PRTI::update(UPDATE_FUNC_ARGS) { rx = sim->portal_rx[count]; ry = sim->portal_ry[count]; - if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) + if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) + { + r = pmap[y+ry][x+rx]; + if (!r) + fe = 1; + if (!r || (!(sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY)) && (r&0xFF)!=PT_SPRK)) { - r = pmap[y+ry][x+rx]; + r = sim->photons[y+ry][x+rx]; if (!r) - fe = 1; - if (!r || (!(sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY)) && (r&0xFF)!=PT_SPRK)) - { - r = sim->photons[y+ry][x+rx]; - if (!r) - continue; - } + continue; + } - if ((r&0xFF)==PT_STKM || (r&0xFF)==PT_STKM2 || (r&0xFF)==PT_FIGH) - continue;// Handling these is a bit more complicated, and is done in STKM_interact() + if ((r&0xFF)==PT_STKM || (r&0xFF)==PT_STKM2 || (r&0xFF)==PT_FIGH) + continue;// Handling these is a bit more complicated, and is done in STKM_interact() - if ((r&0xFF) == PT_SOAP) - sim->detach(r>>8); + if ((r&0xFF) == PT_SOAP) + sim->detach(r>>8); - for ( nnx=0; nnx<80; nnx++) - if (!sim->portalp[parts[i].tmp][count][nnx].type) - { - sim->portalp[parts[i].tmp][count][nnx] = parts[r>>8]; - if ((r&0xFF)==PT_SPRK) - sim->part_change_type(r>>8,x+rx,y+ry,parts[r>>8].ctype); - else - sim->kill_part(r>>8); - fe = 1; - break; - } - } + for ( nnx=0; nnx<80; nnx++) + if (!sim->portalp[parts[i].tmp][count][nnx].type) + { + sim->portalp[parts[i].tmp][count][nnx] = parts[r>>8]; + if ((r&0xFF)==PT_SPRK) + sim->part_change_type(r>>8,x+rx,y+ry,parts[r>>8].ctype); + else + sim->kill_part(r>>8); + fe = 1; + break; + } + } } |
