From 2e323ea018369a2a929a68c725d113156ef50471 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Wed, 10 Aug 2011 18:13:39 +0800 Subject: [PATCH] Update parts_lastActiveIndex when creating neut/phot --- src/elements/neut.c | 1 + src/powder.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/elements/neut.c b/src/elements/neut.c index 0d12a6ddc..85a0be25e 100644 --- a/src/elements/neut.c +++ b/src/elements/neut.c @@ -21,6 +21,7 @@ int create_n_parts(int n, int x, int y, float vx, float vy, float temp, int t)// return -1; i = pfree; pfree = parts[i].life; + if (i>parts_lastActiveIndex) parts_lastActiveIndex = i; parts[i].x = (float)x; parts[i].y = (float)y; diff --git a/src/powder.c b/src/powder.c index 4068e3cda..88cb71351 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1026,6 +1026,7 @@ static void create_gain_photon(int pp)//photons from PHOT going through GLOW return; pfree = parts[i].life; + if (i>parts_lastActiveIndex) parts_lastActiveIndex = i; parts[i].type = PT_PHOT; parts[i].life = 680; @@ -1062,6 +1063,7 @@ static void create_cherenkov_photon(int pp)//photons from NEUT going through GLA return; pfree = parts[i].life; + if (i>parts_lastActiveIndex) parts_lastActiveIndex = i; lr = rand() % 2;