diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-13 00:03:21 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-13 00:03:21 (GMT) |
| commit | 59920c1a622f507b63c3e6308c376287c33ced58 (patch) | |
| tree | 8bd863a1d9e6c3c7d7db50d1d16b6561f8a749d6 /src/simulation | |
| parent | c63de0ff6d55d05e0717f4d2d38a2b3ac860b785 (diff) | |
| download | powder-59920c1a622f507b63c3e6308c376287c33ced58.zip powder-59920c1a622f507b63c3e6308c376287c33ced58.tar.gz | |
TPT: TTAN updates
Diffstat (limited to 'src/simulation')
| -rw-r--r-- | src/simulation/elements/TTAN.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/simulation/elements/TTAN.cpp b/src/simulation/elements/TTAN.cpp index 00ba5fc..66fc76b 100644 --- a/src/simulation/elements/TTAN.cpp +++ b/src/simulation/elements/TTAN.cpp @@ -50,8 +50,25 @@ Element_TTAN::Element_TTAN() //#TPT-Directive ElementHeader Element_TTAN static int update(UPDATE_FUNC_ARGS) int Element_TTAN::update(UPDATE_FUNC_ARGS) { - sim->air->bmap_blockair[y/CELL][x/CELL] = 1; - sim->air->bmap_blockairh[y/CELL][x/CELL] = 1; + int nx, ny, ttan = 0; + if(nt<=2) + ttan = 2; + else if(parts[i].tmp) + ttan = 2; + else if(nt<=6) + for (nx=-1; nx<2; nx++) { + for (ny=-1; ny<2; ny++) { + if ((!nx != !ny) && x+nx>=0 && y+ny>=0 && x+nx<XRES && y+ny<YRES) { + if((pmap[y+ny][x+nx]&0xFF)==PT_TTAN) + ttan++; + } + } + } + + if(ttan>=2) { + sim->air->bmap_blockair[y/CELL][x/CELL] = 1; + sim->air->bmap_blockairh[y/CELL][x/CELL] = 1; + } return 0; } |
