From 065ca8b9f53d861f4ddf474b049f2501ce0586e3 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 17 Apr 2012 16:33:04 +0100 Subject: [PATCH] TPT: Only check the bits actually used for wavelength in photon ctype Fixes black photons not being killed after passing through pipe 748a528fe0 --- src/elements/phot.cpp | 2 +- src/simulation/Simulation.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/elements/phot.cpp b/src/elements/phot.cpp index 407ac2e65..29d534b3b 100644 --- a/src/elements/phot.cpp +++ b/src/elements/phot.cpp @@ -5,7 +5,7 @@ int update_PHOT(UPDATE_FUNC_ARGS) { float rr, rrr; parts[i].pavg[0] = x; parts[i].pavg[1] = y; - if (!parts[i].ctype) { + if (!(parts[i].ctype&0x3FFFFFFF)) { sim->kill_part(i); return 1; } diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index f25a12487..b86b9a73a 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -3003,7 +3003,7 @@ killed: kill_part(i); continue; } - if (!parts[i].ctype&&t!=PT_NEUT&&t!=PT_ELEC) { + if (!(parts[i].ctype&0x3FFFFFFF)&&t!=PT_NEUT&&t!=PT_ELEC) { kill_part(i); continue; }