diff options
| author | jacob1 <jfu614@gmail.com> | 2013-05-30 00:36:34 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-05-30 00:36:34 (GMT) |
| commit | d6d20defdebf72c2b27244a6d4bc8a757a669a59 (patch) | |
| tree | a3802256a9377cf5b048a01a91a31a470be3c7c3 /src/simulation/elements/COAL.cpp | |
| parent | cbc80de6522b5562f9490b0cdb620371f25be2f9 (diff) | |
| parent | 41e369e68eac7b05f8cda312f9668942dc688aa7 (diff) | |
| download | powder-d6d20defdebf72c2b27244a6d4bc8a757a669a59.zip powder-d6d20defdebf72c2b27244a6d4bc8a757a669a59.tar.gz | |
Merge branch 'master' of git@github.com:FacialTurd/The-Powder-Toy.git
Diffstat (limited to 'src/simulation/elements/COAL.cpp')
| -rw-r--r-- | src/simulation/elements/COAL.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/simulation/elements/COAL.cpp b/src/simulation/elements/COAL.cpp index 3186167..b2cc89c 100644 --- a/src/simulation/elements/COAL.cpp +++ b/src/simulation/elements/COAL.cpp @@ -49,7 +49,7 @@ Element_COAL::Element_COAL() //#TPT-Directive ElementHeader Element_COAL static int update(UPDATE_FUNC_ARGS) int Element_COAL::update(UPDATE_FUNC_ARGS) { - int r, rx, ry, trade, temp; + int r, rx, ry, trade, temp, t = parts[i].type; if (parts[i].life<=0) { sim->create_part(i, x, y, PT_FIRE); return 1; @@ -57,13 +57,16 @@ int Element_COAL::update(UPDATE_FUNC_ARGS) parts[i].life--; sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_FIRE); } - if ((sim->pv[y/CELL][x/CELL] > 4.3f)&&parts[i].tmp>40) - parts[i].tmp=39; - else if (parts[i].tmp<40&&parts[i].tmp>0) - parts[i].tmp--; - else if (parts[i].tmp<=0) { - sim->create_part(i, x, y, PT_BCOL); - return 1; + if (t == PT_COAL) + { + if ((sim->pv[y/CELL][x/CELL] > 4.3f)&&parts[i].tmp>40) + parts[i].tmp=39; + else if (parts[i].tmp<40&&parts[i].tmp>0) + parts[i].tmp--; + else if (parts[i].tmp<=0) { + sim->create_part(i, x, y, PT_BCOL); + return 1; + } } /*if(100-parts[i].life > parts[i].tmp2) parts[i].tmp2 = 100-parts[i].life; |
