CAUS.cpp whitespace fixes, closes #464

This commit is contained in:
jacob1
2017-07-13 21:06:26 -04:00
parent 711d15fe0c
commit 781a90a970

View File

@@ -26,7 +26,7 @@ Element_CAUS::Element_CAUS()
Weight = 1; Weight = 1;
Temperature = R_TEMP+0.0f +273.15f; Temperature = R_TEMP+273.15f;
HeatConduct = 70; HeatConduct = 70;
Description = "Caustic Gas, acts like ACID."; Description = "Caustic Gas, acts like ACID.";
@@ -47,12 +47,11 @@ Element_CAUS::Element_CAUS()
//#TPT-Directive ElementHeader Element_CAUS static int update(UPDATE_FUNC_ARGS) //#TPT-Directive ElementHeader Element_CAUS static int update(UPDATE_FUNC_ARGS)
int Element_CAUS::update(UPDATE_FUNC_ARGS) int Element_CAUS::update(UPDATE_FUNC_ARGS)
{ {
int r, rx, ry; for (int rx = -2; rx <= 2; rx++)
for (rx=-2; rx<3; rx++) for (int ry = -2; ry <= 2; ry++)
for (ry=-2; ry<3; ry++)
if (BOUNDS_CHECK && (rx || ry)) if (BOUNDS_CHECK && (rx || ry))
{ {
r = pmap[y+ry][x+rx]; int r = pmap[y+ry][x+rx];
if (!r) if (!r)
continue; continue;
if ((r&0xFF) == PT_GAS) if ((r&0xFF) == PT_GAS)
@@ -67,12 +66,12 @@ int Element_CAUS::update(UPDATE_FUNC_ARGS)
{ {
if (((r&0xFF) != PT_CLNE && (r&0xFF) != PT_PCLN && sim->elements[r&0xFF].Hardness > (rand()%1000)) && parts[i].life >= 50) if (((r&0xFF) != PT_CLNE && (r&0xFF) != PT_PCLN && sim->elements[r&0xFF].Hardness > (rand()%1000)) && parts[i].life >= 50)
{ {
if (sim->parts_avg(i, r>>8,PT_GLAS)!= PT_GLAS)//GLAS protects stuff from acid // GLAS protects stuff from acid
if (sim->parts_avg(i, r>>8,PT_GLAS) != PT_GLAS)
{ {
float newtemp = ((60.0f - (float)sim->elements[r&0xFF].Hardness)) * 7.0f; float newtemp = ((60.0f - (float)sim->elements[r&0xFF].Hardness)) * 7.0f;
if(newtemp < 0){ if (newtemp < 0)
newtemp = 0; newtemp = 0;
}
parts[i].temp += newtemp; parts[i].temp += newtemp;
parts[i].life--; parts[i].life--;
sim->kill_part(r>>8); sim->kill_part(r>>8);