diff --git a/src/simulation/elements/DMG.cpp b/src/simulation/elements/DMG.cpp index e805370422..1e89b7a201 100644 --- a/src/simulation/elements/DMG.cpp +++ b/src/simulation/elements/DMG.cpp @@ -93,7 +93,10 @@ int Element_DMG::update(UPDATE_FUNC_ARGS) else if(t == PT_QRTZ) sim->part_change_type(rr>>8, x+nxi, y+nxj, PT_PQRT); else if(t == PT_TUNG) + { sim->part_change_type(rr>>8, x+nxi, y+nxj, PT_BRMT); + parts[rr>>8].ctype = PT_TUNG; + } } } } diff --git a/src/simulation/elements/GOLD.cpp b/src/simulation/elements/GOLD.cpp index 8536acafd8..655c1bdd82 100644 --- a/src/simulation/elements/GOLD.cpp +++ b/src/simulation/elements/GOLD.cpp @@ -78,8 +78,8 @@ int Element_GOLD::update(UPDATE_FUNC_ARGS) if(!r) continue; if((r&0xFF)==PT_SPRK && parts[r>>8].life && parts[r>>8].life<4) { + sim->part_change_type(i, x, y, PT_SPRK); parts[i].life = 4; - parts[i].type = PT_SPRK; parts[i].ctype = PT_GOLD; } } diff --git a/src/simulation/elements/GVRT.cpp b/src/simulation/elements/GRVT.cpp similarity index 100% rename from src/simulation/elements/GVRT.cpp rename to src/simulation/elements/GRVT.cpp diff --git a/src/simulation/elements/LIGH.cpp b/src/simulation/elements/LIGH.cpp index 5d8a9252ad..599cb93da8 100644 --- a/src/simulation/elements/LIGH.cpp +++ b/src/simulation/elements/LIGH.cpp @@ -204,13 +204,13 @@ int Element_LIGH::update(UPDATE_FUNC_ARGS) multipler=parts[i].life*1.5+rand()%((int)(parts[i].life+1)); rx=cos(angle*M_PI/180)*multipler; ry=-sin(angle*M_PI/180)*multipler; - create_line_par(sim, x, y, x+rx, y+ry, PT_LIGH, parts[i].temp, parts[i].life, angle, 0); + create_line_par(sim, x, y, x+rx, y+ry, PT_LIGH, parts[i].temp, parts[i].life, angle, parts[i].tmp2); if (parts[i].tmp2==2)// && pNear==-1) { angle2= ((int)angle+100-rand()%200)%360; rx=cos(angle2*M_PI/180)*multipler; ry=-sin(angle2*M_PI/180)*multipler; - create_line_par(sim, x, y, x+rx, y+ry, PT_LIGH, parts[i].temp, parts[i].life, angle2, 0); + create_line_par(sim, x, y, x+rx, y+ry, PT_LIGH, parts[i].temp, parts[i].life, angle2, parts[i].tmp2); } parts[i].tmp2=-1; @@ -275,7 +275,7 @@ bool Element_LIGH::create_LIGH(Simulation * sim, int x, int y, int c, int temp, else { sim->parts[p].life = life; - sim->parts[p].tmp2 = tmp2; + sim->parts[p].tmp2 = 0; } } else if (x >= 0 && x < XRES && y >= 0 && y < YRES) diff --git a/src/simulation/elements/NEUT.cpp b/src/simulation/elements/NEUT.cpp index 098732f034..d1c5dc2b17 100644 --- a/src/simulation/elements/NEUT.cpp +++ b/src/simulation/elements/NEUT.cpp @@ -190,22 +190,22 @@ int Element_NEUT::graphics(GRAPHICS_FUNC_ARGS) //#TPT-Directive ElementHeader Element_NEUT static int DeutExplosion(Simulation * sim, int n, int x, int y, float temp, int t) int Element_NEUT::DeutExplosion(Simulation * sim, int n, int x, int y, float temp, int t)//testing a new deut create part { - int i, c; + int i; n = (n/50); - if (n<1) { + if (n < 1) n = 1; - } - if (n>340) { + else if (n > 340) n = 340; - } - for (c=0; ccreate_part(-3, x, y, t); - if (i > -1) + if (i >= 0) sim->parts[i].temp = temp; - - sim->pv[y/CELL][x/CELL] += 6.0f * CFDS; + else if (sim->pfree < 0) + break; } + sim->pv[y/CELL][x/CELL] += (6.0f * CFDS)*n; return 0; } diff --git a/src/simulation/elements/PHOT.cpp b/src/simulation/elements/PHOT.cpp index e792aaf6f2..91305d2df2 100644 --- a/src/simulation/elements/PHOT.cpp +++ b/src/simulation/elements/PHOT.cpp @@ -71,7 +71,10 @@ int Element_PHOT::update(UPDATE_FUNC_ARGS) parts[i].vy *= 0.90; sim->create_part(r>>8, x+rx, y+ry, PT_PHOT); rrr = (rand()%360)*3.14159f/180.0f; - rr = (rand()%128+128)/127.0f; + if ((r&0xFF) == PT_ISOZ) + rr = (rand()%128+128)/127.0f; + else + rr = (rand()%228+128)/127.0f; parts[r>>8].vx = rr*cosf(rrr); parts[r>>8].vy = rr*sinf(rrr); sim->pv[y/CELL][x/CELL] -= 15.0f * CFDS; diff --git a/src/simulation/elements/PROT.cpp b/src/simulation/elements/PROT.cpp index 45580570a6..2457117ef6 100644 --- a/src/simulation/elements/PROT.cpp +++ b/src/simulation/elements/PROT.cpp @@ -162,19 +162,20 @@ int Element_PROT::DeutImplosion(Simulation * sim, int n, int x, int y, float tem { int i; n = (n/50); - if (n<1) + if (n < 1) n = 1; - else if (n>340) + else if (n > 340) n = 340; - for (int c=0; ccreate_part(-3, x, y, t); if (i >= 0) sim->parts[i].temp = temp; - - sim->pv[y/CELL][x/CELL] -= 6.0f * CFDS; + else if (sim->pfree < 0) + break; } + sim->pv[y/CELL][x/CELL] -= (6.0f * CFDS)*n; return 0; } diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp index 35a3842156..c05f95cc1f 100644 --- a/src/simulation/elements/SPRK.cpp +++ b/src/simulation/elements/SPRK.cpp @@ -246,7 +246,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS) if (pavg == PT_INSL) continue; //Insulation blocks everything past here if (!((sim->elements[receiver].Properties&PROP_CONDUCTS)||receiver==PT_INST||receiver==PT_QRTZ)) continue; //Stop non-conducting recievers, allow INST and QRTZ as special cases if (abs(rx)+abs(ry)>=4 &&sender!=PT_SWCH&&receiver!=PT_SWCH) continue; //Only switch conducts really far - if (receiver==sender && receiver!=PT_INST) goto conduct; //Everything conducts to itself, except INST. + if (receiver==sender && receiver!=PT_INST && receiver!=PT_QRTZ) goto conduct; //Everything conducts to itself, except INST. //Sender cases, where elements can have specific outputs switch (sender)