summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacksonmj <jacksonmj@jacksonmj.none>2011-01-28 22:47:00 (GMT)
committer jacksonmj <jacksonmj@jacksonmj.none>2011-01-28 23:14:46 (GMT)
commitfe033ce859b1d5db91fa840e0353403ab19b0d3a (patch)
tree6b1252a35d656f5653052fdacbc6b5b5822725e9
parenta5ff51f5a508b35980502ebce46c4a3822ecb4b4 (diff)
downloadpowder-fe033ce859b1d5db91fa840e0353403ab19b0d3a.zip
powder-fe033ce859b1d5db91fa840e0353403ab19b0d3a.tar.gz
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.
-rw-r--r--includes/powder.h6
-rw-r--r--src/elements/sprk.c2
-rw-r--r--src/powder.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/includes/powder.h b/includes/powder.h
index e033e02..f402b65 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 0f3c6c7..58692ee 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 add5f48..a065329 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;