diff options
| author | Cracker64 <cracker642@gmail.com> | 2011-02-23 01:55:09 (GMT) |
|---|---|---|
| committer | Cracker64 <cracker642@gmail.com> | 2011-02-23 01:55:09 (GMT) |
| commit | a8439f221e7bc4a8314aa84d4be60dfa68d16831 (patch) | |
| tree | d18263ade6a48e709699e590cd8e2ecd78e3fd71 /src/elements | |
| parent | 89b19bcbeea3c90f3a30a409a113c165eb5edf39 (diff) | |
| download | powder-a8439f221e7bc4a8314aa84d4be60dfa68d16831.zip powder-a8439f221e7bc4a8314aa84d4be60dfa68d16831.tar.gz | |
updating
Diffstat (limited to 'src/elements')
| -rw-r--r-- | src/elements/bcln.c | 14 | ||||
| -rw-r--r-- | src/elements/goo.c | 14 |
2 files changed, 12 insertions, 16 deletions
diff --git a/src/elements/bcln.c b/src/elements/bcln.c index 3581fc2..36ad347 100644 --- a/src/elements/bcln.c +++ b/src/elements/bcln.c @@ -1,15 +1,13 @@ #include <element.h> int update_BCLN(UPDATE_FUNC_ARGS) { - if (!parts[i].life) + if (!parts[i].life && pv[y/CELL][x/CELL]>4.0f) + parts[i].life = rand()%40+80; + if (parts[i].life) { - if (pv[y/CELL][x/CELL]>4.0f) - { - float advection = 0.1f; - parts[i].vx += advection*vx[y/CELL][x/CELL]; - parts[i].vy += advection*vy[y/CELL][x/CELL]; - parts[i].life = rand()%40+80; - } + float advection = 0.1f; + parts[i].vx += advection*vx[y/CELL][x/CELL]; + parts[i].vy += advection*vy[y/CELL][x/CELL]; } if (!parts[i].ctype) { diff --git a/src/elements/goo.c b/src/elements/goo.c index 0818173..a3176e1 100644 --- a/src/elements/goo.c +++ b/src/elements/goo.c @@ -1,15 +1,13 @@ #include <element.h> int update_GOO(UPDATE_FUNC_ARGS) { - if (!parts[i].life) + if (!parts[i].life && pv[y/CELL][x/CELL]>1.0f) + parts[i].life = rand()%80+300; + if (parts[i].life) { - if (pv[y/CELL][x/CELL]>1.0f) - { - float advection = 0.1f; - parts[i].vx += advection*vx[y/CELL][x/CELL]; - parts[i].vy += advection*vy[y/CELL][x/CELL]; - parts[i].life = rand()%80+300; - } + float advection = 0.1f; + parts[i].vx += advection*vx[y/CELL][x/CELL]; + parts[i].vy += advection*vy[y/CELL][x/CELL]; } return 0; } |
