From 8e02443f0a294fcec9bcc8678dcf8b61f0d56f99 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Fri, 1 Feb 2013 14:29:18 -0500 Subject: [PATCH] prevent CRAY from destroying DMND --- src/simulation/elements/CRAY.cpp | 2 +- src/simulation/elements/STOR.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simulation/elements/CRAY.cpp b/src/simulation/elements/CRAY.cpp index 93c8db9aa..b3f51ff98 100644 --- a/src/simulation/elements/CRAY.cpp +++ b/src/simulation/elements/CRAY.cpp @@ -96,7 +96,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS) colored = wavelengthToDecoColour(parts[r>>8].ctype); } else if ((r&0xFF)==PT_CRAY || nostop) { docontinue = 1; - } else if(destroy) { + } else if(destroy && (r&0xFF != PT_DMND)) { sim->kill_part(r>>8); if(!--partsRemaining) docontinue = 0; diff --git a/src/simulation/elements/STOR.cpp b/src/simulation/elements/STOR.cpp index fd82b7a9c..a9f5d94b0 100644 --- a/src/simulation/elements/STOR.cpp +++ b/src/simulation/elements/STOR.cpp @@ -72,7 +72,7 @@ int Element_STOR::update(UPDATE_FUNC_ARGS) if(parts[i].tmp && (r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_PSCN && parts[r>>8].life>0 && parts[r>>8].life<4) { for(ry1 = 1; ry1 >= -1; ry1--){ - for(rx1 = 0; rx1 >= -1 && rx1 <= 1; rx1 = -rx1-rx1+1){ // Oscilate the X starting at 0, 1, -1, 3, -5, etc (Though stop at -1) + for(rx1 = 0; rx1 >= -1 && rx1 <= 1; rx1 = -rx1-rx1+1){ // Oscillate the X starting at 0, 1, -1, 3, -5, etc (Though stop at -1) np = sim->create_part(-1,x+rx1,y+ry1,parts[i].tmp); if (np!=-1) {