summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-06-25 21:44:07 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-06-25 21:44:07 (GMT)
commit7351da3962afed0c46391372373238fdf6e8347c (patch)
treeb4ebe720612ce68c8f60b2f44b53d8e82795c53e /src/elements
parentf3927f7202d67366872c85d132b2f8266d5220b5 (diff)
downloadpowder-7351da3962afed0c46391372373238fdf6e8347c.zip
powder-7351da3962afed0c46391372373238fdf6e8347c.tar.gz
Fix segfault with aray striking particles with abnormal ctype
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/aray.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/elements/aray.c b/src/elements/aray.c
index b1a2e91..9604fba 100644
--- a/src/elements/aray.c
+++ b/src/elements/aray.c
@@ -50,7 +50,7 @@ int update_ARAY(UPDATE_FUNC_ARGS) {
create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK);
}
//if (!(nostop && (ptypes[r&0xFF].properties&PROP_CONDUCTS))) {//don't need to check r&0xFF<PT_NUM here because it should have been excluded by (r>>8)>=NPART //Not sure why you changed checking "ctype" to "type"
- if (!(nostop && (ptypes[parts[r>>8].ctype].properties&PROP_CONDUCTS))) {
+ if (!(nostop && parts[r>>8].ctype >= 0 && parts[r>>8].ctype < PT_NUM && (ptypes[parts[r>>8].ctype].properties&PROP_CONDUCTS))) {
docontinue = 0;
} else {
docontinue = 1;