diff options
Diffstat (limited to 'src/simulation/elements')
| -rw-r--r-- | src/simulation/elements/BANG.cpp | 7 | ||||
| -rw-r--r-- | src/simulation/elements/CO2.cpp | 6 | ||||
| -rw-r--r-- | src/simulation/elements/LOLZ.cpp | 22 | ||||
| -rw-r--r-- | src/simulation/elements/LOVE.cpp | 22 |
4 files changed, 38 insertions, 19 deletions
diff --git a/src/simulation/elements/BANG.cpp b/src/simulation/elements/BANG.cpp index 2dc660a..b0ff983 100644 --- a/src/simulation/elements/BANG.cpp +++ b/src/simulation/elements/BANG.cpp @@ -75,8 +75,11 @@ int Element_BANG::update(UPDATE_FUNC_ARGS) } else if(parts[i].tmp==1) { - int tempvalue = 2; - sim->flood_prop(x, y, offsetof(Particle, tmp), &tempvalue, StructProperty::Integer); + if ((pmap[y][x]>>8 == i)) + { + int tempvalue = 2; + sim->flood_prop(x, y, offsetof(Particle, tmp), &tempvalue, StructProperty::Integer); + } parts[i].tmp = 2; } else if(parts[i].tmp==2) diff --git a/src/simulation/elements/CO2.cpp b/src/simulation/elements/CO2.cpp index 4e29286..ca5cc31 100644 --- a/src/simulation/elements/CO2.cpp +++ b/src/simulation/elements/CO2.cpp @@ -71,11 +71,11 @@ int Element_CO2::update(UPDATE_FUNC_ARGS) } if (((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW) && 1>(rand()%250)) { - sim->part_change_type(i,x,y,PT_CBNW); + sim->part_change_type(r>>8, x+rx, y+ry, PT_CBNW); if (parts[i].ctype==5) //conserve number of water particles - ctype=5 means this CO2 hasn't released the water particle from BUBW yet - sim->create_part(r>>8, x+rx, y+ry, PT_CBNW); + sim->create_part(i, x, y, PT_WATR); else - sim->kill_part(r>>8); + sim->kill_part(i); } } if (parts[i].temp > 9773.15 && sim->pv[y/CELL][x/CELL] > 200.0f) diff --git a/src/simulation/elements/LOLZ.cpp b/src/simulation/elements/LOLZ.cpp index 6feae3f..a5e8371 100644 --- a/src/simulation/elements/LOLZ.cpp +++ b/src/simulation/elements/LOLZ.cpp @@ -46,16 +46,24 @@ Element_LOLZ::Element_LOLZ() } +//#TPT-Directive ElementHeader Element_LOLZ static int RuleTable[9][9] +int Element_LOLZ::RuleTable[9][9] = +{ + {0,0,0,0,0,0,0,0,0}, + {1,0,0,0,0,0,1,0,0}, + {1,0,0,0,0,0,1,0,0}, + {1,0,0,1,1,0,0,1,0}, + {1,0,1,0,0,1,0,1,0}, + {1,0,1,0,0,1,0,1,0}, + {0,1,0,1,1,0,0,1,0}, + {0,1,0,0,0,0,0,1,0}, + {0,1,0,0,0,0,0,1,0}, +}; + //#TPT-Directive ElementHeader Element_LOLZ static int update(UPDATE_FUNC_ARGS) int Element_LOLZ::update(UPDATE_FUNC_ARGS) { - /*int t = parts[i].type; - if (t==PT_LOVE) - ISLOVE=1; - else if (t==PT_LOLZ) - ISLOLZ=1; - else if (t==PT_GRAV) - ISGRAV=1;*/ + sim->ISLOLZ = true; return 0; } diff --git a/src/simulation/elements/LOVE.cpp b/src/simulation/elements/LOVE.cpp index 28a20b7..3e7b3d4 100644 --- a/src/simulation/elements/LOVE.cpp +++ b/src/simulation/elements/LOVE.cpp @@ -46,16 +46,24 @@ Element_LOVE::Element_LOVE() } +//#TPT-Directive ElementHeader Element_LOVE static int RuleTable[9][9] +int Element_LOVE::RuleTable[9][9] = +{ + {0,0,1,1,0,0,0,0,0}, + {0,1,0,0,1,1,0,0,0}, + {1,0,0,0,0,0,1,0,0}, + {1,0,0,0,0,0,0,1,0}, + {0,1,0,0,0,0,0,0,1}, + {1,0,0,0,0,0,0,1,0}, + {1,0,0,0,0,0,1,0,0}, + {0,1,0,0,1,1,0,0,0}, + {0,0,1,1,0,0,0,0,0}, +}; + //#TPT-Directive ElementHeader Element_LOVE static int update(UPDATE_FUNC_ARGS) int Element_LOVE::update(UPDATE_FUNC_ARGS) { - /*int t = parts[i].type; - if (t==PT_LOVE) - ISLOVE=1; - else if (t==PT_LOLZ) - ISLOLZ=1; - else if (t==PT_GRAV) - ISGRAV=1;*/ + sim->ISLOVE = true; return 0; } |
