summaryrefslogtreecommitdiff
path: root/src/simulation/elements/PRTI.cpp
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2013-03-02 05:42:07 (GMT)
committer cracker64 <cracker642@gmail.com>2013-03-02 05:42:07 (GMT)
commitd58100dc070be97073d1f02cdbb7a382a67c376b (patch)
treecc0fc022e7f8524b7f9bcf5ed93eb83980596f91 /src/simulation/elements/PRTI.cpp
parenta9f4b5fe343fb0ada8934030abe6363695ea43dc (diff)
downloadpowder-d58100dc070be97073d1f02cdbb7a382a67c376b.zip
powder-d58100dc070be97073d1f02cdbb7a382a67c376b.tar.gz
More fixes, redid a bunch of SPRK, so far everything I've tested works fine.
Diffstat (limited to 'src/simulation/elements/PRTI.cpp')
-rw-r--r--src/simulation/elements/PRTI.cpp50
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;
+ }
+ }
}