From de4fe1a38ec1114c384ddbb5ab68c7aa22541eed Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 25 Jul 2012 18:23:07 +0100 Subject: TPT: Reduce rate of lightning creation by clone 167740e839 diff --git a/src/simulation/elements/BCLN.cpp b/src/simulation/elements/BCLN.cpp index 0e93011..457a9aa 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 f76ed75..62c67c0 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 af37a59..088f807 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 41701bc..1b814b0 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) -- cgit v0.9.2-21-gd62e