summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSavely Skresanov <savask@yandex.ru>2012-05-30 10:23:53 (GMT)
committer Savely Skresanov <savask@yandex.ru>2012-05-30 10:25:37 (GMT)
commit58620a95290e42455585b8265efe310b17514ed4 (patch)
tree74f879dfb8b1abc68ed4a7beee67d5cfcd6e6eef /src
parent90f09f3a062dae4e93fc25e1c52f82f37e15a2d7 (diff)
downloadpowder-58620a95290e42455585b8265efe310b17514ed4.zip
powder-58620a95290e42455585b8265efe310b17514ed4.tar.gz
Fixed the bug with snow, where it melted without taking it's ctype into
account.
Diffstat (limited to 'src')
-rw-r--r--src/elementdata.c2
-rw-r--r--src/powder.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/elementdata.c b/src/elementdata.c
index 797da75..2f7af25 100644
--- a/src/elementdata.c
+++ b/src/elementdata.c
@@ -223,7 +223,7 @@ part_transition ptransitions[PT_NUM] =
/* ICE */ {IPL, NT, 0.8f, PT_SNOW, ITL, NT, 233.0f, ST},
/* METL */ {IPL, NT, IPH, NT, ITL, NT, 1273.0f,PT_LAVA},
/* SPRK */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
- /* SNOW */ {IPL, NT, IPH, NT, ITL, NT, 273.0f, PT_WATR},
+ /* SNOW */ {IPL, NT, IPH, NT, ITL, NT, 273.0f, ST},
/* WOOD */ {IPL, NT, IPH, NT, ITL, NT, 873.0f, PT_FIRE},
/* NEUT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PLUT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
diff --git a/src/powder.c b/src/powder.c
index 83a180a..7f797d0 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -2000,7 +2000,7 @@ void update_particles_i(pixel *vid, int start, int inc)
s = 1;
//A fix for ice with ctype = 0
- if (t==PT_ICEI && (parts[i].ctype==0 || parts[i].ctype>=PT_NUM || parts[i].ctype==PT_ICEI))
+ if ((t==PT_ICEI || t==PT_SNOW) && (parts[i].ctype==0 || parts[i].ctype>=PT_NUM || parts[i].ctype==PT_ICEI || parts[i].ctype==PT_SNOW))
parts[i].ctype = PT_WATR;
if (ctemph>ptransitions[t].thv&&ptransitions[t].tht>-1) {
@@ -2024,9 +2024,9 @@ void update_particles_i(pixel *vid, int start, int inc)
if (ptransitions[t].tht!=PT_NUM)
t = ptransitions[t].tht;
#endif
- else if (t==PT_ICEI) {
- if (parts[i].ctype<PT_NUM&&parts[i].ctype!=PT_ICEI) {
- if (ptransitions[parts[i].ctype].tlt==PT_ICEI&&pt<=ptransitions[parts[i].ctype].tlv) s = 0;
+ else if (t==PT_ICEI || t==PT_SNOW) {
+ if (parts[i].ctype<PT_NUM&&parts[i].ctype!=t) {
+ if (ptransitions[parts[i].ctype].tlt==t&&pt<=ptransitions[parts[i].ctype].tlv) s = 0;
else {
#ifdef REALISTIC
//One ice table value for all it's kinds
@@ -2131,7 +2131,7 @@ void update_particles_i(pixel *vid, int start, int inc)
}
#endif
if (s) { // particle type change occurred
- if (t==PT_ICEI||t==PT_LAVA)
+ if (t==PT_ICEI||t==PT_LAVA||t==PT_SNOW)
parts[i].ctype = parts[i].type;
if (!(t==PT_ICEI&&parts[i].ctype==PT_FRZW)) parts[i].life = 0;
if (ptypes[t].state==ST_GAS&&ptypes[parts[i].type].state!=ST_GAS)