mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 19:29:52 +02:00
TPT: TTAN updates
This commit is contained in:
@@ -50,8 +50,25 @@ Element_TTAN::Element_TTAN()
|
|||||||
//#TPT-Directive ElementHeader Element_TTAN static int update(UPDATE_FUNC_ARGS)
|
//#TPT-Directive ElementHeader Element_TTAN static int update(UPDATE_FUNC_ARGS)
|
||||||
int Element_TTAN::update(UPDATE_FUNC_ARGS)
|
int Element_TTAN::update(UPDATE_FUNC_ARGS)
|
||||||
{
|
{
|
||||||
sim->air->bmap_blockair[y/CELL][x/CELL] = 1;
|
int nx, ny, ttan = 0;
|
||||||
sim->air->bmap_blockairh[y/CELL][x/CELL] = 1;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user