diff --git a/src/simulation/elements/H2.cpp b/src/simulation/elements/H2.cpp index 6bcbb2e9ad..4610fd8cbb 100644 --- a/src/simulation/elements/H2.cpp +++ b/src/simulation/elements/H2.cpp @@ -96,6 +96,7 @@ int Element_H2::update(UPDATE_FUNC_ARGS) int j; float temp = parts[i].temp; sim->create_part(i,x,y,PT_NBLE); + parts[i].tmp = 0x1; j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT); if (j>-1) diff --git a/src/simulation/elements/NBLE.cpp b/src/simulation/elements/NBLE.cpp index 02e2953ef8..5c689f5935 100644 --- a/src/simulation/elements/NBLE.cpp +++ b/src/simulation/elements/NBLE.cpp @@ -51,7 +51,7 @@ int Element_NBLE::update(UPDATE_FUNC_ARGS) { if (parts[i].temp > 5273.15 && sim->pv[y/CELL][x/CELL] > 100.0f) { - parts[i].tmp = 1; + parts[i].tmp |= 0x1; if (!(rand()%5)) { int j; diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp index 6dfde78338..423c05c68c 100644 --- a/src/simulation/elements/SPRK.cpp +++ b/src/simulation/elements/SPRK.cpp @@ -48,8 +48,8 @@ Element_SPRK::Element_SPRK() //#TPT-Directive ElementHeader Element_SPRK static int update(UPDATE_FUNC_ARGS) int Element_SPRK::update(UPDATE_FUNC_ARGS) - { - int r, rx, ry, rt, conduct_sprk, nearp, pavg, ct = parts[i].ctype, sender, receiver; +{ + int r, rx, ry, nearp, pavg, ct = parts[i].ctype, sender, receiver; Element_FIRE::update(UPDATE_FUNC_SUBCALL_ARGS); if (parts[i].life<=0) @@ -96,13 +96,13 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS) } break; case PT_NBLE: - if (parts[i].life<=1 && parts[i].temp<5273.15f) + if (parts[i].life<=1 && !(parts[i].tmp&0x1)) { parts[i].life = rand()%150+50; sim->part_change_type(i,x,y,PT_PLSM); parts[i].ctype = PT_NBLE; if (parts[i].temp > 5273.15) - parts[i].tmp |= 4; + parts[i].tmp |= 0x4; parts[i].temp = 3500; sim->pv[y/CELL][x/CELL] += 1; } @@ -302,7 +302,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS) goto conduct; continue; case PT_NBLE: - if (parts[i].temp < 5273.15f) + if (!(parts[i].tmp&0x1)) goto conduct; continue; case PT_PSCN: