From 66a530f5a3ec8c82a5f1300f0b50720b0c8a34e4 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Wed, 5 Nov 2014 23:38:22 +0000 Subject: [PATCH] FRZZ and FRZW changes/fixes Fix FRZW low temperature transition (accidentally turned into a high temperature transition in b661418d). 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). --- src/simulation/elements/FRZW.cpp | 8 ++++---- src/simulation/elements/FRZZ.cpp | 2 +- src/simulation/elements/ICEI.cpp | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/simulation/elements/FRZW.cpp b/src/simulation/elements/FRZW.cpp index 39d2bd348..3ed0a0fbf 100644 --- a/src/simulation/elements/FRZW.cpp +++ b/src/simulation/elements/FRZW.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; diff --git a/src/simulation/elements/FRZZ.cpp b/src/simulation/elements/FRZZ.cpp index f52780438..7995e81b1 100644 --- a/src/simulation/elements/FRZZ.cpp +++ b/src/simulation/elements/FRZZ.cpp @@ -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; diff --git a/src/simulation/elements/ICEI.cpp b/src/simulation/elements/ICEI.cpp index a9c87b65b..fd77d1cae 100644 --- a/src/simulation/elements/ICEI.cpp +++ b/src/simulation/elements/ICEI.cpp @@ -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; }