From 065ca8b9f53d861f4ddf474b049f2501ce0586e3 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 17 Apr 2012 16:33:04 +0100 Subject: TPT: Only check the bits actually used for wavelength in photon ctype Fixes black photons not being killed after passing through pipe 748a528fe0 diff --git a/src/elements/phot.cpp b/src/elements/phot.cpp index 407ac2e..29d534b 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 f25a124..b86b9a7 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; } -- cgit v0.9.2-21-gd62e