From fe033ce859b1d5db91fa840e0353403ab19b0d3a Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Fri, 28 Jan 2011 22:47:00 +0000 Subject: [PATCH] INWR should cool after being sparked; and correct function parameters Also correct grule size and replicate existing freezing point behaviour for lava with strange ctypes. --- includes/powder.h | 6 +++--- src/elements/sprk.c | 2 +- src/powder.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index e033e0214..f402b6507 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -687,9 +687,9 @@ static part_transition ptransitions[PT_NUM] = #undef ST -static int grule[NGOL][9] = +static int grule[NGOL][10] = { -// 0,1,2,3,4,5,6,7,8,STATES live=1 spawn=2 spawn&live=3 States are kind of how long until it dies, normal ones use two states(living,dead) for others the intermediate states live but do nothing +// 0,1,2,3,4,5,6,7,8,STATES live=1 spawn=2 spawn&live=3 States are kind of how long until it dies, normal ones use two states(living,dead) for others the intermediate states live but do nothing {0,0,0,0,0,0,0,0,0,2},//blank {0,0,1,3,0,0,0,0,0,2},//GOL {0,0,1,3,0,0,2,0,0,2},//HLIF @@ -804,7 +804,7 @@ static void create_gain_photon(int pp); void kill_part(int i); #if defined(WIN32) && !defined(__GNUC__) -extern _inline void part_change_type(int n, int x, int y, int t); +extern _inline void part_change_type(int i, int x, int y, int t); #else extern inline void part_change_type(int i, int x, int y, int t); #endif diff --git a/src/elements/sprk.c b/src/elements/sprk.c index 0f3c6c7c5..58692ee5d 100644 --- a/src/elements/sprk.c +++ b/src/elements/sprk.c @@ -5,7 +5,7 @@ int update_SPRK(UPDATE_FUNC_ARGS) { int r, rx, ry, rt, conduct_sprk, nearp, pavg, ct = parts[i].ctype; if (parts[i].life<=0) { - if (ct==PT_WATR||ct==PT_SLTW||ct==PT_PSCN||ct==PT_NSCN||ct==PT_ETRD) + if (ct==PT_WATR||ct==PT_SLTW||ct==PT_PSCN||ct==PT_NSCN||ct==PT_ETRD||ct==PT_INWR) parts[i].temp = R_TEMP + 273.15f; if (!ct) ct = PT_METL; diff --git a/src/powder.c b/src/powder.c index add5f4826..a0653291f 100644 --- a/src/powder.c +++ b/src/powder.c @@ -450,7 +450,7 @@ void kill_part(int i) } #if defined(WIN32) && !defined(__GNUC__) -_inline void part_change_type(int n, int x, int y, int t) +_inline void part_change_type(int i, int x, int y, int t) #else inline void part_change_type(int i, int x, int y, int t) #endif @@ -465,7 +465,7 @@ inline void part_change_type(int i, int x, int y, int t) } #if defined(WIN32) && !defined(__GNUC__) -_inline int create_n_parts(int n, int x, int y, int t) +_inline int create_n_parts(int n, int x, int y, float vx, float vy, int t) #else inline int create_n_parts(int n, int x, int y, float vx, float vy, int t) #endif @@ -1124,7 +1124,7 @@ void update_particles_i(pixel *vid, int start, int inc) float mv, dx, dy, ix, iy, lx, ly, nrx, nry, dp; int fin_x, fin_y, clear_x, clear_y; float fin_xf, fin_yf, clear_xf, clear_yf; - float nn, ct1, ct2; + float nn, ct1, ct2, swappage; float pt = R_TEMP; float c_heat = 0.0f; int h_count = 0; @@ -1467,7 +1467,6 @@ void update_particles_i(pixel *vid, int start, int inc) if (!legacy_enable) { if (y-2 >= 0 && y-2 < YRES && (ptypes[t].properties&TYPE_LIQUID)) { - float swappage; r = pmap[y-2][x]; if (!((r>>8)>=NPART || !r || parts[i].type != (r&0xFF))) { if (parts[i].temp>parts[r>>8].temp) { @@ -1539,6 +1538,7 @@ void update_particles_i(pixel *vid, int start, int inc) if (parts[i].ctype&&parts[i].ctype!=PT_LAVA) { if (ptransitions[parts[i].ctype].tht==PT_LAVA&&pt>=ptransitions[parts[i].ctype].thv) s = 0; else if (parts[i].ctype==PT_THRM&&pt>=ptransitions[PT_BMTL].thv) s = 0; + else if (pt>=973.0f) s = 0; // freezing point for lava with any other (not listed in ptransitions as turning into lava) ctype else { t = parts[i].ctype; parts[i].ctype = PT_NONE;