diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-25 18:32:36 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-25 18:32:36 (GMT) |
| commit | f8766201a688598633e41166225d5e77275a2d5a (patch) | |
| tree | e90eaf8bf33373596fc39d1eee08fe8ee708be5e /src/simulation/elements | |
| parent | 76070f99e0e9e4817f17dc55489756276b7b58c3 (diff) | |
| download | powder-f8766201a688598633e41166225d5e77275a2d5a.zip powder-f8766201a688598633e41166225d5e77275a2d5a.tar.gz | |
TPT: Optimization for GoL, Added brush size and mouse wheel to lua! e7035233fd
Diffstat (limited to 'src/simulation/elements')
| -rw-r--r-- | src/simulation/elements/PLNT.cpp | 2 | ||||
| -rw-r--r-- | src/simulation/elements/STKM.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/simulation/elements/PLNT.cpp b/src/simulation/elements/PLNT.cpp index 92a4fdf..9c87e22 100644 --- a/src/simulation/elements/PLNT.cpp +++ b/src/simulation/elements/PLNT.cpp @@ -73,7 +73,7 @@ int Element_PLNT::update(UPDATE_FUNC_ARGS) sim->kill_part(r>>8); parts[i].life = rand()%60 + 60; } - else if (surround_space && ((r&0xFF)==PT_WOOD) && (1>rand()%20) && (abs(rx+ry)<=2) && (VINE_MODE || parts[i].tmp==1) ) + else if (surround_space && ((r&0xFF)==PT_WOOD) && (1>rand()%20) && (abs(rx+ry)<=2) && (sim->VINE_MODE || parts[i].tmp==1) ) { int nnx = rand()%3 -1; int nny = rand()%3 -1; diff --git a/src/simulation/elements/STKM.cpp b/src/simulation/elements/STKM.cpp index fb0ade0..ee35105 100644 --- a/src/simulation/elements/STKM.cpp +++ b/src/simulation/elements/STKM.cpp @@ -510,15 +510,15 @@ void Element_STKM::STKM_interact(Simulation * sim, playerst* playerp, int i, int break; } } - if (((r&0xFF)==PT_BHOL || (r&0xFF)==PT_NBHL) && parts[i].type) + if (((r&0xFF)==PT_BHOL || (r&0xFF)==PT_NBHL) && sim->parts[i].type) { if (!sim->legacy_enable) { - parts[r>>8].temp = restrict_flt(parts[r>>8].temp+parts[i].temp/2, MIN_TEMP, MAX_TEMP); + sim->parts[r>>8].temp = restrict_flt(sim->parts[r>>8].temp+sim->parts[i].temp/2, MIN_TEMP, MAX_TEMP); } sim->kill_part(i); } - if (((r&0xFF)==PT_VOID || ((r&0xFF)==PT_PVOD && parts[r>>8].life==10)) && (!parts[r>>8].ctype || (parts[r>>8].ctype==parts[i].type)!=(parts[r>>8].tmp&1)) && parts[i].type) + if (((r&0xFF)==PT_VOID || ((r&0xFF)==PT_PVOD && sim->parts[r>>8].life==10)) && (!sim->parts[r>>8].ctype || (sim->parts[r>>8].ctype==sim->parts[i].type)!=(sim->parts[r>>8].tmp&1)) && sim->parts[i].type) { sim->kill_part(i); } |
