TPT: Prevent ARAY passing through some non-conductive materials, and let normal ARAY pass through sparked INWR d21c61aa52

This commit is contained in:
Simon Robertshaw 2012-04-18 14:59:24 +01:00
parent eeff570f89
commit ce7d749dda

View File

@ -44,12 +44,11 @@ int update_ARAY(UPDATE_FUNC_ARGS) {
} else if ((r&0xFF)==PT_FILT) {//get color if passed through FILT } else if ((r&0xFF)==PT_FILT) {//get color if passed through FILT
colored = parts[r>>8].ctype; colored = parts[r>>8].ctype;
//this if prevents BRAY from stopping on certain materials //this if prevents BRAY from stopping on certain materials
} else if ((r&0xFF)!=PT_STOR && (r&0xFF)!=PT_INWR && (r&0xFF)!=PT_ARAY && (r&0xFF)!=PT_WIFI && !((r&0xFF)==PT_SWCH && parts[r>>8].life>=10)) { } else if ((r&0xFF)!=PT_STOR && (r&0xFF)!=PT_INWR && ((r&0xFF)!=PT_SPRK || parts[r>>8].ctype!=PT_INWR) && (r&0xFF)!=PT_ARAY && (r&0xFF)!=PT_WIFI && !((r&0xFF)==PT_SWCH && parts[r>>8].life>=10)) {
if (nyy!=0 || nxx!=0) { if (nyy!=0 || nxx!=0) {
sim->create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK); sim->create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK);
} }
//if (!(nostop && (ptypes[r&0xFF].properties&PROP_CONDUCTS))) { if (!(nostop && parts[r>>8].type==PT_SPRK && parts[r>>8].ctype >= 0 && parts[r>>8].ctype < PT_NUM && (sim->ptypes[parts[r>>8].ctype].properties&PROP_CONDUCTS))) {
if (!(nostop && parts[r>>8].ctype >= 0 && parts[r>>8].ctype < PT_NUM && (sim->ptypes[parts[r>>8].ctype].properties&PROP_CONDUCTS))) {
docontinue = 0; docontinue = 0;
} else { } else {
docontinue = 1; docontinue = 1;