Update parts_lastActiveIndex when creating neut/phot

This commit is contained in:
jacksonmj 2011-08-10 18:13:39 +08:00 committed by Simon Robertshaw
parent 1713604233
commit 2e323ea018
2 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,7 @@ int create_n_parts(int n, int x, int y, float vx, float vy, float temp, int t)//
return -1; return -1;
i = pfree; i = pfree;
pfree = parts[i].life; pfree = parts[i].life;
if (i>parts_lastActiveIndex) parts_lastActiveIndex = i;
parts[i].x = (float)x; parts[i].x = (float)x;
parts[i].y = (float)y; parts[i].y = (float)y;

View File

@ -1026,6 +1026,7 @@ static void create_gain_photon(int pp)//photons from PHOT going through GLOW
return; return;
pfree = parts[i].life; pfree = parts[i].life;
if (i>parts_lastActiveIndex) parts_lastActiveIndex = i;
parts[i].type = PT_PHOT; parts[i].type = PT_PHOT;
parts[i].life = 680; parts[i].life = 680;
@ -1062,6 +1063,7 @@ static void create_cherenkov_photon(int pp)//photons from NEUT going through GLA
return; return;
pfree = parts[i].life; pfree = parts[i].life;
if (i>parts_lastActiveIndex) parts_lastActiveIndex = i;
lr = rand() % 2; lr = rand() % 2;