Fixed the bug with snow, where it melted without taking it's ctype into

account.
This commit is contained in:
Savely Skresanov 2012-05-30 17:23:53 +07:00
parent 90f09f3a06
commit 58620a9529
2 changed files with 6 additions and 6 deletions

View File

@ -223,7 +223,7 @@ part_transition ptransitions[PT_NUM] =
/* ICE */ {IPL, NT, 0.8f, PT_SNOW, ITL, NT, 233.0f, ST}, /* ICE */ {IPL, NT, 0.8f, PT_SNOW, ITL, NT, 233.0f, ST},
/* METL */ {IPL, NT, IPH, NT, ITL, NT, 1273.0f,PT_LAVA}, /* METL */ {IPL, NT, IPH, NT, ITL, NT, 1273.0f,PT_LAVA},
/* SPRK */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT}, /* 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}, /* WOOD */ {IPL, NT, IPH, NT, ITL, NT, 873.0f, PT_FIRE},
/* NEUT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT}, /* NEUT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* PLUT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT}, /* PLUT */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},

View File

@ -2000,7 +2000,7 @@ void update_particles_i(pixel *vid, int start, int inc)
s = 1; s = 1;
//A fix for ice with ctype = 0 //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; parts[i].ctype = PT_WATR;
if (ctemph>ptransitions[t].thv&&ptransitions[t].tht>-1) { 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) if (ptransitions[t].tht!=PT_NUM)
t = ptransitions[t].tht; t = ptransitions[t].tht;
#endif #endif
else if (t==PT_ICEI) { else if (t==PT_ICEI || t==PT_SNOW) {
if (parts[i].ctype<PT_NUM&&parts[i].ctype!=PT_ICEI) { if (parts[i].ctype<PT_NUM&&parts[i].ctype!=t) {
if (ptransitions[parts[i].ctype].tlt==PT_ICEI&&pt<=ptransitions[parts[i].ctype].tlv) s = 0; if (ptransitions[parts[i].ctype].tlt==t&&pt<=ptransitions[parts[i].ctype].tlv) s = 0;
else { else {
#ifdef REALISTIC #ifdef REALISTIC
//One ice table value for all it's kinds //One ice table value for all it's kinds
@ -2131,7 +2131,7 @@ void update_particles_i(pixel *vid, int start, int inc)
} }
#endif #endif
if (s) { // particle type change occurred 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; parts[i].ctype = parts[i].type;
if (!(t==PT_ICEI&&parts[i].ctype==PT_FRZW)) parts[i].life = 0; 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) if (ptypes[t].state==ST_GAS&&ptypes[parts[i].type].state!=ST_GAS)