diff options
Diffstat (limited to 'src/simulation/elements/GLOW.cpp')
| -rw-r--r-- | src/simulation/elements/GLOW.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/simulation/elements/GLOW.cpp b/src/simulation/elements/GLOW.cpp index 775e188..373fc51 100644 --- a/src/simulation/elements/GLOW.cpp +++ b/src/simulation/elements/GLOW.cpp @@ -57,21 +57,17 @@ int Element_GLOW::update(UPDATE_FUNC_ARGS) r = pmap[y+ry][x+rx]; if (!r) continue; - if ((r&0xFF)==PT_WATR&&5>(rand()%2000)) + if ((r&0xFF)==PT_WATR && !(rand()%400)) { - parts[i].type = PT_NONE; + sim->kill_part(i); sim->part_change_type(r>>8,x+rx,y+ry,PT_DEUT); parts[r>>8].life = 10; + return 1; } } parts[i].ctype = sim->pv[y/CELL][x/CELL]*16; - parts[i].tmp = abs((int)((sim->vx[y/CELL][x/CELL]+sim->vy[y/CELL][x/CELL])*16.0f)) + abs((int)((parts[i].vx+parts[i].vy)*64.0f)); - //printf("%f %f\n", parts[i].vx, parts[i].vy); - if (parts[i].type==PT_NONE) { - sim->kill_part(i); - return 1; - } + return 0; } @@ -93,4 +89,4 @@ int Element_GLOW::graphics(GRAPHICS_FUNC_ARGS) } -Element_GLOW::~Element_GLOW() {}
\ No newline at end of file +Element_GLOW::~Element_GLOW() {} |
