mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-08 15:00:42 +02:00
fix directly sparking metal not heating it up, fix formatting, allowing update_particles_i to be parsed
This commit is contained in:
@@ -2722,23 +2722,28 @@ int Simulation::create_part(int p, int x, int y, int tv)
|
|||||||
|
|
||||||
if (t==PT_SPRK)
|
if (t==PT_SPRK)
|
||||||
{
|
{
|
||||||
if((pmap[y][x]&0xFF)==PT_WIRE){
|
int type = pmap[y][x]&0xFF;
|
||||||
parts[pmap[y][x]>>8].ctype=PT_DUST;
|
int index = pmap[y][x]>>8;
|
||||||
|
if(type == PT_WIRE)
|
||||||
|
{
|
||||||
|
parts[index].ctype = PT_DUST;
|
||||||
}
|
}
|
||||||
if (!((pmap[y][x]&0xFF)==PT_INST||(elements[pmap[y][x]&0xFF].Properties&PROP_CONDUCTS)))
|
if (!(type == PT_INST || (elements[type].Properties&PROP_CONDUCTS)))
|
||||||
return -1;
|
return -1;
|
||||||
if (parts[pmap[y][x]>>8].life!=0)
|
if (parts[index].life!=0)
|
||||||
return -1;
|
return -1;
|
||||||
if (p==-2 && (pmap[y][x]&0xFF)==PT_INST)
|
if (p == -2 && type == PT_INST)
|
||||||
{
|
{
|
||||||
FloodINST(x, y, PT_SPRK, PT_INST);
|
FloodINST(x, y, PT_SPRK, PT_INST);
|
||||||
return pmap[y][x]>>8;
|
return index;
|
||||||
}
|
}
|
||||||
parts[pmap[y][x]>>8].type = PT_SPRK;
|
parts[index].type = PT_SPRK;
|
||||||
parts[pmap[y][x]>>8].life = 4;
|
parts[index].life = 4;
|
||||||
parts[pmap[y][x]>>8].ctype = pmap[y][x]&0xFF;
|
parts[index].ctype = type;
|
||||||
pmap[y][x] = (pmap[y][x]&~0xFF) | PT_SPRK;
|
pmap[y][x] = (pmap[y][x]&~0xFF) | PT_SPRK;
|
||||||
return pmap[y][x]>>8;
|
if (parts[index].temp+10.0f < 673.0f && !legacy_enable && (type==PT_METL || type == PT_BMTL || type == PT_BRMT || type == PT_PSCN || type == PT_NSCN || type == PT_ETRD || type == PT_NBLE || type == PT_IRON))
|
||||||
|
parts[index].temp = parts[index].temp+10.0f;
|
||||||
|
return index;
|
||||||
}
|
}
|
||||||
if (t==PT_SPAWN&&elementCount[PT_SPAWN])
|
if (t==PT_SPAWN&&elementCount[PT_SPAWN])
|
||||||
return -1;
|
return -1;
|
||||||
@@ -3725,7 +3730,7 @@ void Simulation::update_particles_i(int start, int inc)
|
|||||||
{
|
{
|
||||||
float c_Cm = 0.0f;
|
float c_Cm = 0.0f;
|
||||||
#else
|
#else
|
||||||
if (t&&(t!=PT_HSWC||parts[i].life==10)&&(elements[t].HeatConduct*gel_scale)>(rand()%250))
|
if (t&&(t!=PT_HSWC||parts[i].life==10)&&(elements[t].HeatConduct*gel_scale)>(rand()%250))
|
||||||
{
|
{
|
||||||
float c_Cm = 0.0f;
|
float c_Cm = 0.0f;
|
||||||
#endif
|
#endif
|
||||||
@@ -3976,7 +3981,11 @@ void Simulation::update_particles_i(int start, int inc)
|
|||||||
parts[i].temp = MAX_TEMP;
|
parts[i].temp = MAX_TEMP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef REALISTIC //needed to fix update_particles_i parsing
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP);
|
else parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user