summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-18 13:59:24 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-18 13:59:24 (GMT)
commitce7d749dda46fb068fa0496bfcb6aba6387f30d5 (patch)
tree9c8dbd0b6e832fc67080db921f23125eb59aeedf /src
parenteeff570f89ff5519df26dc4c85739a49f7b9d1a0 (diff)
downloadpowder-ce7d749dda46fb068fa0496bfcb6aba6387f30d5.zip
powder-ce7d749dda46fb068fa0496bfcb6aba6387f30d5.tar.gz
TPT: Prevent ARAY passing through some non-conductive materials, and let normal ARAY pass through sparked INWR d21c61aa52
Diffstat (limited to 'src')
-rw-r--r--src/elements/aray.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/elements/aray.cpp b/src/elements/aray.cpp
index f1fe0f6..8505d81 100644
--- a/src/elements/aray.cpp
+++ b/src/elements/aray.cpp
@@ -44,12 +44,11 @@ int update_ARAY(UPDATE_FUNC_ARGS) {
} else if ((r&0xFF)==PT_FILT) {//get color if passed through FILT
colored = parts[r>>8].ctype;
//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) {
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].ctype >= 0 && parts[r>>8].ctype < PT_NUM && (sim->ptypes[parts[r>>8].ctype].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))) {
docontinue = 0;
} else {
docontinue = 1;