Skip to content

Commit

Permalink
FRZZ and FRZW changes/fixes
Browse files Browse the repository at this point in the history
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 66a530f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/simulation/elements/FRZW.cpp
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/simulation/elements/FRZZ.cpp
Expand Up @@ -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;

Expand Down
5 changes: 4 additions & 1 deletion src/simulation/elements/ICEI.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 66a530f

Please sign in to comment.