TPT: Reduce rate of lightning creation by clone 167740e839

This commit is contained in:
Simon Robertshaw 2012-07-25 18:23:07 +01:00
parent 5337f91736
commit de4fe1a38e
4 changed files with 4 additions and 4 deletions

View File

@ -82,7 +82,7 @@ int Element_BCLN::update(UPDATE_FUNC_ARGS)
} }
else { 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)); 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); int np = sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
if (np>=0) if (np>=0)

View File

@ -74,7 +74,7 @@ int Element_CLNE::update(UPDATE_FUNC_ARGS)
} }
else { 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)); 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); int np = sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
if (np>=0) if (np>=0)

View File

@ -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); int np = sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
if (np>=0) if (np>=0)

View File

@ -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); int np = sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
if (np>=0) if (np>=0)