From de4fe1a38ec1114c384ddbb5ab68c7aa22541eed Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 25 Jul 2012 18:23:07 +0100 Subject: [PATCH] TPT: Reduce rate of lightning creation by clone 167740e839 --- src/simulation/elements/BCLN.cpp | 2 +- src/simulation/elements/CLNE.cpp | 2 +- src/simulation/elements/PBCN.cpp | 2 +- src/simulation/elements/PCLN.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/simulation/elements/BCLN.cpp b/src/simulation/elements/BCLN.cpp index 0e93011a2..457a9aa9c 100644 --- a/src/simulation/elements/BCLN.cpp +++ b/src/simulation/elements/BCLN.cpp @@ -82,7 +82,7 @@ int Element_BCLN::update(UPDATE_FUNC_ARGS) } else { if (parts[i].ctype==PT_LIFE) sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype|(parts[i].tmp<<8)); - else + else if (parts[i].ctype!=PT_LIGH || (rand()%30)==0) { int np = sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); if (np>=0) diff --git a/src/simulation/elements/CLNE.cpp b/src/simulation/elements/CLNE.cpp index f76ed7541..62c67c02b 100644 --- a/src/simulation/elements/CLNE.cpp +++ b/src/simulation/elements/CLNE.cpp @@ -74,7 +74,7 @@ int Element_CLNE::update(UPDATE_FUNC_ARGS) } else { if (parts[i].ctype==PT_LIFE) sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype|(parts[i].tmp<<8)); - else + else if (parts[i].ctype!=PT_LIGH || (rand()%30)==0) { int np = sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); if (np>=0) diff --git a/src/simulation/elements/PBCN.cpp b/src/simulation/elements/PBCN.cpp index af37a5966..088f8077c 100644 --- a/src/simulation/elements/PBCN.cpp +++ b/src/simulation/elements/PBCN.cpp @@ -136,7 +136,7 @@ int Element_PBCN::update(UPDATE_FUNC_ARGS) } } } - else + else if (parts[i].ctype!=PT_LIGH || (rand()%30)==0) { int np = sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); if (np>=0) diff --git a/src/simulation/elements/PCLN.cpp b/src/simulation/elements/PCLN.cpp index 41701bc86..1b814b092 100644 --- a/src/simulation/elements/PCLN.cpp +++ b/src/simulation/elements/PCLN.cpp @@ -126,7 +126,7 @@ int Element_PCLN::update(UPDATE_FUNC_ARGS) } } } - else + else if (parts[i].ctype!=PT_LIGH || (rand()%30)==0) { int np = sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype); if (np>=0)