Permalink
Browse files

FRZZ and FRZW changes/fixes

Fix FRZW low temperature transition (accidentally turned into a high temperature transition in b661418).
FRZZ now melts into FRZW, so that single pixels "form ice that always cools" as in FRZZ description.
ICE update function: was meant to be checking not setting parts[i].ctype. However, turning FRZZ into self-cooling ice seems a logical thing to do, so set ctype of parts[r>>8].ctype, and make all types of ice cause this reaction (not just ICE(FRZW) as was apparently the original intention of the ctype check).
  • Loading branch information...
jacksonmj committed Nov 5, 2014
1 parent 9e7ead9 commit 66a530f5a3ec8c82a5f1300f0b50720b0c8a34e4
Showing with 9 additions and 6 deletions.
  1. +4 −4 src/simulation/elements/FRZW.cpp
  2. +1 −1 src/simulation/elements/FRZZ.cpp
  3. +4 −1 src/simulation/elements/ICEI.cpp
@@ -37,10 +37,10 @@ Element_FRZW::Element_FRZW()
LowPressureTransition = NT;
HighPressure = IPH;
HighPressureTransition = NT;
LowTemperature = ITL;
LowTemperatureTransition = NT;
HighTemperature = 53.0f;
HighTemperatureTransition = PT_ICEI;
LowTemperature = 53.0f;
LowTemperatureTransition = PT_ICEI;
HighTemperature = ITH;
HighTemperatureTransition = NT;
Update = &Element_FRZW::update;
@@ -40,7 +40,7 @@ Element_FRZZ::Element_FRZZ()
LowTemperature = 50.0f;
LowTemperatureTransition = PT_ICEI;
HighTemperature = 273.15;
HighTemperatureTransition = PT_WATR;
HighTemperatureTransition = PT_FRZW;
Update = &Element_FRZZ::update;
@@ -70,8 +70,11 @@ int Element_ICEI::update(UPDATE_FUNC_ARGS)
return 0;
}
}
else if (((r&0xFF)==PT_FRZZ) && (parts[i].ctype=PT_FRZW) && !(rand()%200))
else if (((r&0xFF)==PT_FRZZ) && !(rand()%200))
{
sim->part_change_type(r>>8,x+rx,y+ry,PT_ICEI);
parts[r>>8].ctype = PT_FRZW;
}
}
return 0;
}

0 comments on commit 66a530f

Please sign in to comment.