Permalink
Browse files

convert r&0xFF in src/simulation/elements

  • Loading branch information...
jacob1 committed Dec 28, 2017
1 parent 4b1c929 commit 208cf14ce81428332499fa7d4bd8110971d06e22
Showing with 247 additions and 242 deletions.
  1. +1 −1 src/simulation/elements/ACEL.cpp
  2. +8 −7 src/simulation/elements/ACID.cpp
  3. +1 −1 src/simulation/elements/AMTR.cpp
  4. +1 −1 src/simulation/elements/ANAR.cpp
  5. +2 −2 src/simulation/elements/ARAY.cpp
  6. +1 −1 src/simulation/elements/BANG.cpp
  7. +1 −1 src/simulation/elements/BCLN.cpp
  8. +1 −1 src/simulation/elements/BIZR.cpp
  9. +1 −1 src/simulation/elements/BMTL.cpp
  10. +1 −1 src/simulation/elements/BOMB.cpp
  11. +2 −2 src/simulation/elements/BOYL.cpp
  12. +1 −1 src/simulation/elements/BRMT.cpp
  13. +1 −1 src/simulation/elements/BTRY.cpp
  14. +1 −1 src/simulation/elements/C5.cpp
  15. +4 −4 src/simulation/elements/CAUS.cpp
  16. +5 −5 src/simulation/elements/CBNW.cpp
  17. +1 −1 src/simulation/elements/CLNE.cpp
  18. +3 −3 src/simulation/elements/CLST.cpp
  19. +2 −2 src/simulation/elements/CO2.cpp
  20. +10 −9 src/simulation/elements/CONV.cpp
  21. +6 −6 src/simulation/elements/CRAY.cpp
  22. +1 −1 src/simulation/elements/DCEL.cpp
  23. +8 −5 src/simulation/elements/DEST.cpp
  24. +2 −2 src/simulation/elements/DEUT.cpp
  25. +3 −3 src/simulation/elements/DLAY.cpp
  26. +2 −2 src/simulation/elements/DMG.cpp
  27. +1 −1 src/simulation/elements/DRAY.cpp
  28. +4 −4 src/simulation/elements/DTEC.cpp
  29. +1 −1 src/simulation/elements/ELEC.cpp
  30. +1 −1 src/simulation/elements/EMBR.cpp
  31. +1 −1 src/simulation/elements/ETRD.cpp
  32. +2 −2 src/simulation/elements/EXOT.cpp
  33. +8 −8 src/simulation/elements/Element.cpp
  34. +2 −2 src/simulation/elements/FIRE.cpp
  35. +1 −1 src/simulation/elements/FIRW.cpp
  36. +2 −2 src/simulation/elements/FOG.cpp
  37. +2 −2 src/simulation/elements/FRAY.cpp
  38. +1 −1 src/simulation/elements/FRZW.cpp
  39. +1 −1 src/simulation/elements/FRZZ.cpp
  40. +1 −1 src/simulation/elements/FSEP.cpp
  41. +1 −1 src/simulation/elements/FUSE.cpp
  42. +3 −3 src/simulation/elements/GBMB.cpp
  43. +1 −1 src/simulation/elements/GEL.cpp
  44. +1 −1 src/simulation/elements/GLOW.cpp
  45. +2 −2 src/simulation/elements/GOLD.cpp
  46. +1 −1 src/simulation/elements/GPMP.cpp
  47. +1 −1 src/simulation/elements/H2.cpp
  48. +4 −4 src/simulation/elements/HEAC.cpp
  49. +2 −2 src/simulation/elements/HSWC.cpp
  50. +2 −2 src/simulation/elements/ICEI.cpp
  51. +1 −1 src/simulation/elements/IGNT.cpp
  52. +1 −1 src/simulation/elements/IRON.cpp
  53. +1 −1 src/simulation/elements/LCRY.cpp
  54. +5 −5 src/simulation/elements/LIGH.cpp
  55. +1 −1 src/simulation/elements/LSNS.cpp
  56. +2 −2 src/simulation/elements/MERC.cpp
  57. +2 −2 src/simulation/elements/O2.cpp
  58. +2 −2 src/simulation/elements/PBCN.cpp
  59. +3 −3 src/simulation/elements/PCLN.cpp
  60. +5 −5 src/simulation/elements/PHOT.cpp
  61. +12 −12 src/simulation/elements/PIPE.cpp
  62. +6 −6 src/simulation/elements/PRTI.cpp
  63. +1 −1 src/simulation/elements/PSNS.cpp
  64. +7 −7 src/simulation/elements/PSTN.cpp
  65. +1 −1 src/simulation/elements/PUMP.cpp
  66. +2 −2 src/simulation/elements/PVOD.cpp
  67. +2 −2 src/simulation/elements/QRTZ.cpp
  68. +2 −2 src/simulation/elements/RIME.cpp
  69. +1 −1 src/simulation/elements/RPEL.cpp
  70. +2 −2 src/simulation/elements/SHLD1.cpp
  71. +2 −2 src/simulation/elements/SHLD2.cpp
  72. +2 −2 src/simulation/elements/SHLD3.cpp
  73. +2 −2 src/simulation/elements/SHLD4.cpp
  74. +2 −2 src/simulation/elements/SING.cpp
  75. +1 −1 src/simulation/elements/SLTW.cpp
  76. +1 −1 src/simulation/elements/SNOW.cpp
  77. +5 −5 src/simulation/elements/SOAP.cpp
  78. +3 −3 src/simulation/elements/SPNG.cpp
  79. +2 −2 src/simulation/elements/SPRK.cpp
  80. +12 −12 src/simulation/elements/STKM.cpp
  81. +3 −3 src/simulation/elements/STOR.cpp
  82. +1 −1 src/simulation/elements/SWCH.cpp
  83. +2 −2 src/simulation/elements/THDR.cpp
  84. +2 −2 src/simulation/elements/TRON.cpp
  85. +4 −4 src/simulation/elements/TSNS.cpp
  86. +1 −1 src/simulation/elements/TUNG.cpp
  87. +8 −8 src/simulation/elements/VIBR.cpp
  88. +5 −5 src/simulation/elements/VIRS.cpp
  89. +1 −1 src/simulation/elements/WARP.cpp
  90. +5 −5 src/simulation/elements/WATR.cpp
  91. +3 −3 src/simulation/elements/WIFI.cpp
  92. +3 −3 src/simulation/elements/WIRE.cpp
  93. +1 −1 src/simulation/elements/WTRV.cpp
  94. +1 −1 src/simulation/elements/YEST.cpp
@@ -69,7 +69,7 @@ int Element_ACEL::update(UPDATE_FUNC_ARGS)
r = sim->photons[y+ry][x+rx];
if (!r)
continue;
if(sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))
if(sim->elements[TYP(r)].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))
{
parts[ID(r)].vx *= multiplier;
parts[ID(r)].vy *= multiplier;
@@ -57,16 +57,17 @@ int Element_ACID::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_ACID && (r&0xFF)!=PT_CAUS)
int rt = TYP(r);
if (rt != PT_ACID && rt != PT_CAUS)
{
if ((r&0xFF)==PT_PLEX || (r&0xFF)==PT_NITR || (r&0xFF)==PT_GUNP || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD)
if (rt == PT_PLEX || rt == PT_NITR || rt == PT_GUNP || rt == PT_RBDM || rt == PT_LRBD)
{
sim->part_change_type(i,x,y,PT_FIRE);
sim->part_change_type(ID(r),x+rx,y+ry,PT_FIRE);
parts[i].life = 4;
parts[ID(r)].life = 4;
}
else if ((r&0xFF)==PT_WTRV)
else if (rt == PT_WTRV)
{
if(!(rand()%250))
{
@@ -75,11 +76,11 @@ int Element_ACID::update(UPDATE_FUNC_ARGS)
sim->kill_part(ID(r));
}
}
else if (((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && sim->elements[r&0xFF].Hardness>(rand()%1000))&&parts[i].life>=50)
else if ((rt != PT_CLNE && rt != PT_PCLN && sim->elements[rt].Hardness>(rand()%1000))&&parts[i].life>=50)
{
if (sim->parts_avg(i, ID(r),PT_GLAS)!= PT_GLAS)//GLAS protects stuff from acid
{
float newtemp = ((60.0f-(float)sim->elements[r&0xFF].Hardness))*7.0f;
float newtemp = ((60.0f-(float)sim->elements[rt].Hardness))*7.0f;
if(newtemp < 0){
newtemp = 0;
}
@@ -104,10 +105,10 @@ int Element_ACID::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_ACID && (parts[i].life>parts[ID(r)].life) && parts[i].life>0)//diffusion
if (TYP(r) == PT_ACID && (parts[i].life > parts[ID(r)].life) && parts[i].life>0)//diffusion
{
int temp = parts[i].life - parts[ID(r)].life;
if (temp==1)
if (temp == 1)
{
parts[ID(r)].life++;
parts[i].life--;
@@ -56,7 +56,7 @@ int Element_AMTR::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
rt = r&0xFF;
rt = TYP(r);
if (rt!=PT_AMTR && rt!=PT_DMND && rt!=PT_CLNE && rt!=PT_PCLN && rt!=PT_VOID && rt!=PT_BHOL && rt!=PT_NBHL && rt!=PT_PRTI && rt!=PT_PRTO)
{
parts[i].life++;
@@ -58,7 +58,7 @@ int Element_ANAR::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_CFLM && !(rand()%4))
if (TYP(r)==PT_CFLM && !(rand()%4))
{
sim->part_change_type(i,x,y,PT_CFLM);
parts[i].life = rand()%150+50;
@@ -56,7 +56,7 @@ int Element_ARAY::update(UPDATE_FUNC_ARGS)
int r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF) == PT_SPRK && parts[ID(r)].life == 3)
if (TYP(r) == PT_SPRK && parts[ID(r)].life == 3)
{
bool isBlackDeco = false;
int destroy = (parts[ID(r)].ctype==PT_PSCN) ? 1 : 0;
@@ -68,7 +68,7 @@ int Element_ARAY::update(UPDATE_FUNC_ARGS)
break;
r = pmap[y+nyi+nyy][x+nxi+nxx];
rt = r & 0xFF;
rt = TYP(r);
r = ID(r);
if (!rt)
{
@@ -60,7 +60,7 @@ int Element_BANG::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM || (r&0xFF)==PT_SPRK || (r&0xFF)==PT_LIGH)
if (TYP(r)==PT_FIRE || TYP(r)==PT_PLSM || TYP(r)==PT_SPRK || TYP(r)==PT_LIGH)
{
parts[i].tmp = 1;
}
@@ -68,7 +68,7 @@ int Element_BCLN::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
rt = r&0xFF;
rt = TYP(r);
if (rt!=PT_CLNE && rt!=PT_PCLN &&
rt!=PT_BCLN && rt!=PT_STKM &&
rt!=PT_PBCN && rt!=PT_STKM2 &&
@@ -60,7 +60,7 @@ int Element_BIZR::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_BIZR && (r&0xFF)!=PT_BIZRG && (r&0xFF)!=PT_BIZRS)
if (TYP(r)!=PT_BIZR && TYP(r)!=PT_BIZRG && TYP(r)!=PT_BIZRS)
{
tr = (parts[ID(r)].dcolour>>16)&0xFF;
tg = (parts[ID(r)].dcolour>>8)&0xFF;
@@ -58,7 +58,7 @@ int Element_BMTL::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if (((r&0xFF)==PT_METL || (r&0xFF)==PT_IRON) && !(rand()%100))
if ((TYP(r)==PT_METL || TYP(r)==PT_IRON) && !(rand()%100))
{
sim->part_change_type(ID(r),x+rx,y+ry,PT_BMTL);
parts[ID(r)].tmp=(parts[i].tmp<=7)?parts[i].tmp=1:parts[i].tmp-(rand()%5);//rand()/(RAND_MAX/300)+100;
@@ -57,7 +57,7 @@ int Element_BOMB::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
rt = r&0xFF;
rt = TYP(r);
if (rt!=PT_BOMB && rt!=PT_EMBR && rt!=PT_DMND && rt!=PT_CLNE && rt!=PT_PCLN && rt!=PT_BCLN && rt!=PT_VIBR)
{
int rad = 8, nt;
@@ -68,12 +68,12 @@ int Element_BOYL::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_WATR)
if (TYP(r)==PT_WATR)
{
if (!(rand()%30))
sim->part_change_type(ID(r),x+rx,y+ry,PT_FOG);
}
else if ((r&0xFF)==PT_O2)
else if (TYP(r)==PT_O2)
{
if (!(rand()%9))
{
@@ -60,7 +60,7 @@ int Element_BRMT::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_BREC && !(rand()%tempFactor))
if (TYP(r)==PT_BREC && !(rand()%tempFactor))
{
if(rand()%2)
{
@@ -55,7 +55,7 @@ int Element_BTRY::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
rt = (r&0xFF);
rt = TYP(r);
if (sim->parts_avg(i,ID(r),PT_INSL) != PT_INSL)
{
if ((sim->elements[rt].Properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[ID(r)].life==0)
@@ -56,7 +56,7 @@ int Element_C5::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if (((r&0xFF)!=PT_C5 && parts[ID(r)].temp<100 && sim->elements[r&0xFF].HeatConduct && ((r&0xFF)!=PT_HSWC||parts[ID(r)].life==10)) || (r&0xFF)==PT_CFLM)
if ((TYP(r)!=PT_C5 && parts[ID(r)].temp<100 && sim->elements[TYP(r)].HeatConduct && (TYP(r)!=PT_HSWC||parts[ID(r)].life==10)) || TYP(r)==PT_CFLM)
{
if (!(rand()%6))
{
@@ -54,22 +54,22 @@ int Element_CAUS::update(UPDATE_FUNC_ARGS)
int r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF) == PT_GAS)
if (TYP(r) == PT_GAS)
{
if (sim->pv[(y+ry)/CELL][(x+rx)/CELL] > 3)
{
sim->part_change_type(ID(r), x+rx, y+ry, PT_RFRG);
sim->part_change_type(i, x, y, PT_RFRG);
}
}
else if ((r&0xFF) != PT_ACID && (r&0xFF) != PT_CAUS && (r&0xFF) != PT_RFRG && (r&0xFF) != PT_RFGL)
else if (TYP(r) != PT_ACID && TYP(r) != PT_CAUS && TYP(r) != PT_RFRG && TYP(r) != PT_RFGL)
{
if (((r&0xFF) != PT_CLNE && (r&0xFF) != PT_PCLN && sim->elements[r&0xFF].Hardness > (rand()%1000)) && parts[i].life >= 50)
if ((TYP(r) != PT_CLNE && TYP(r) != PT_PCLN && sim->elements[TYP(r)].Hardness > (rand()%1000)) && parts[i].life >= 50)
{
// GLAS protects stuff from acid
if (sim->parts_avg(i, ID(r),PT_GLAS) != PT_GLAS)
{
float newtemp = ((60.0f - (float)sim->elements[r&0xFF].Hardness)) * 7.0f;
float newtemp = ((60.0f - (float)sim->elements[TYP(r)].Hardness)) * 7.0f;
if (newtemp < 0)
newtemp = 0;
parts[i].temp += newtemp;
@@ -84,18 +84,18 @@ int Element_CBNW::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((sim->elements[r&0xFF].Properties&TYPE_PART) && parts[i].tmp == 0 && !(rand()%83))
if ((sim->elements[TYP(r)].Properties&TYPE_PART) && parts[i].tmp == 0 && !(rand()%83))
{
//Start explode
parts[i].tmp = rand()%25;//(rand()%100)+50;
}
else if((sim->elements[r&0xFF].Properties&TYPE_SOLID) && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_GLAS && parts[i].tmp == 0 && (2-sim->pv[y/CELL][x/CELL])>(rand()%6667))
else if((sim->elements[TYP(r)].Properties&TYPE_SOLID) && TYP(r)!=PT_DMND && TYP(r)!=PT_GLAS && parts[i].tmp == 0 && (2-sim->pv[y/CELL][x/CELL])>(rand()%6667))
{
sim->part_change_type(i,x,y,PT_CO2);
parts[i].ctype = 5;
sim->pv[y/CELL][x/CELL] += 0.2f;
}
if ((r&0xFF)==PT_CBNW)
if (TYP(r)==PT_CBNW)
{
if(!parts[i].tmp)
{
@@ -113,7 +113,7 @@ int Element_CBNW::update(UPDATE_FUNC_ARGS)
parts[ID(r)].tmp++;
}
}
else if ((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD)
else if (TYP(r)==PT_RBDM||TYP(r)==PT_LRBD)
{
if ((sim->legacy_enable||parts[i].temp>(273.15f+12.0f)) && !(rand()%166))
{
@@ -122,7 +122,7 @@ int Element_CBNW::update(UPDATE_FUNC_ARGS)
parts[i].ctype = PT_WATR;
}
}
else if ((r&0xFF)==PT_FIRE && parts[ID(r)].ctype!=PT_WATR){
else if (TYP(r)==PT_FIRE && parts[ID(r)].ctype!=PT_WATR){
sim->kill_part(ID(r));
if(!(rand()%50)){
sim->kill_part(i);
@@ -59,7 +59,7 @@ int Element_CLNE::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
rt = r&0xFF;
rt = TYP(r);
if (rt!=PT_CLNE && rt!=PT_PCLN &&
rt!=PT_BCLN && rt!=PT_STKM &&
rt!=PT_PBCN && rt!=PT_STKM2 &&
@@ -57,20 +57,20 @@ int Element_CLST::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_WATR)
if (TYP(r)==PT_WATR)
{
if (!(rand()%1500))
{
sim->create_part(i, x, y, PT_PSTS);
sim->kill_part(ID(r));
}
}
else if ((r&0xFF)==PT_NITR)
else if (TYP(r)==PT_NITR)
{
sim->create_part(i, x, y, PT_BANG);
sim->create_part(ID(r), x+rx, y+ry, PT_BANG);
}
else if ((r&0xFF)==PT_CLST)
else if (TYP(r)==PT_CLST)
{
if(parts[i].temp <195)
cxy = 0.05;
@@ -62,14 +62,14 @@ int Element_CO2::update(UPDATE_FUNC_ARGS)
}
continue;
}
if ((r&0xFF)==PT_FIRE){
if (TYP(r)==PT_FIRE){
sim->kill_part(ID(r));
if(!(rand()%30)){
sim->kill_part(i);
return 1;
}
}
else if (((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW) && !(rand()%50))
else if ((TYP(r)==PT_WATR || TYP(r)==PT_DSTW) && !(rand()%50))
{
sim->part_change_type(ID(r), x+rx, y+ry, PT_CBNW);
if (parts[i].ctype==5) //conserve number of water particles - ctype=5 means this CO2 hasn't released the water particle from BUBW yet
@@ -60,13 +60,14 @@ int Element_CONV::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN &&
(r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM &&
(r&0xFF)!=PT_PBCN && (r&0xFF)!=PT_STKM2 &&
(r&0xFF)!=PT_CONV && (r&0xFF)<PT_NUM)
int rt = TYP(r);
if (rt != PT_CLNE && rt != PT_PCLN &&
rt != PT_BCLN && rt != PT_STKM &&
rt != PT_PBCN && rt != PT_STKM2 &&
rt != PT_CONV && rt < PT_NUM)
{
parts[i].ctype = r&0xFF;
if ((r&0xFF)==PT_LIFE)
parts[i].ctype = rt;
if (rt == PT_LIFE)
parts[i].ctype |= PMAPID(parts[ID(r)].ctype);
}
}
@@ -79,11 +80,11 @@ int Element_CONV::update(UPDATE_FUNC_ARGS)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
{
r = sim->photons[y+ry][x+rx];
if (!r || (restrictElement && (r&0xFF)!=restrictElement))
if (!r || (restrictElement && TYP(r) != restrictElement))
r = pmap[y+ry][x+rx];
if (!r || (restrictElement && (r&0xFF)!=restrictElement))
if (!r || (restrictElement && TYP(r) != restrictElement))
continue;
if((r&0xFF)!=PT_CONV && (r&0xFF)!=PT_DMND && (r&0xFF)!=ctype)
if (TYP(r) != PT_CONV && TYP(r) != PT_DMND && TYP(r) != ctype)
{
sim->create_part(ID(r), x+rx, y+ry, parts[i].ctype&0xFF, ID(parts[i].ctype));
}
@@ -60,9 +60,9 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)!=PT_CRAY && (r&0xFF)!=PT_PSCN && (r&0xFF)!=PT_INST && (r&0xFF)!=PT_METL && (r&0xFF)!=PT_SPRK && (r&0xFF)<PT_NUM)
if (TYP(r)!=PT_CRAY && TYP(r)!=PT_PSCN && TYP(r)!=PT_INST && TYP(r)!=PT_METL && TYP(r)!=PT_SPRK && TYP(r)<PT_NUM)
{
parts[i].ctype = r&0xFF;
parts[i].ctype = TYP(r);
parts[i].temp = parts[ID(r)].temp;
}
}
@@ -76,7 +76,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS)
int r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_SPRK && parts[ID(r)].life==3) { //spark found, start creating
if (TYP(r)==PT_SPRK && parts[ID(r)].life==3) { //spark found, start creating
unsigned int colored = 0;
bool destroy = parts[ID(r)].ctype==PT_PSCN;
bool nostop = parts[ID(r)].ctype==PT_INST;
@@ -102,7 +102,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS)
if(!--partsRemaining)
docontinue = 0;
}
} else if ((r&0xFF)==PT_FILT) { // get color if passed through FILT
} else if (TYP(r)==PT_FILT) { // get color if passed through FILT
if (parts[ID(r)].dcolour == 0xFF000000)
colored = 0xFF000000;
else if (parts[ID(r)].tmp==0)
@@ -112,9 +112,9 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS)
else if (colored==0xFF000000)
colored = 0;
parts[ID(r)].life = 4;
} else if ((r&0xFF) == PT_CRAY || nostop) {
} else if (TYP(r) == PT_CRAY || nostop) {
docontinue = 1;
} else if(destroy && r && ((r&0xFF) != PT_DMND)) {
} else if(destroy && r && (TYP(r) != PT_DMND)) {
sim->kill_part(ID(r));
if(!--partsRemaining)
docontinue = 0;
@@ -64,7 +64,7 @@ int Element_DCEL::update(UPDATE_FUNC_ARGS)
r = sim->photons[y+ry][x+rx];
if (!r)
continue;
if (sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))
if (sim->elements[TYP(r)].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))
{
parts[ID(r)].vx *= multiplier;
parts[ID(r)].vy *= multiplier;
Oops, something went wrong.

0 comments on commit 208cf14

Please sign in to comment.