summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsavask <savask@yandex.ru>2012-04-19 14:40:28 (GMT)
committer savask <savask@yandex.ru>2012-04-19 14:42:25 (GMT)
commitf93a829672c7aabb09ae9b958623a97105b8e28d (patch)
tree58cbe37c3167e2e5deb65614a8e3aeceda6af732 /src
parent62ecf1d87e40f2aed0af0a4838f9680fcf81e47d (diff)
downloadpowder-f93a829672c7aabb09ae9b958623a97105b8e28d.zip
powder-f93a829672c7aabb09ae9b958623a97105b8e28d.tar.gz
Fix sponge bug.
Diffstat (limited to 'src')
-rw-r--r--src/elementdata.c2
-rw-r--r--src/powder.c7
-rw-r--r--src/save.c5
3 files changed, 11 insertions, 3 deletions
diff --git a/src/elementdata.c b/src/elementdata.c
index f72efa3..aa2544e 100644
--- a/src/elementdata.c
+++ b/src/elementdata.c
@@ -104,7 +104,7 @@ part_type ptypes[PT_NUM] =
{"LIGH", PIXPACK(0xFFFFC0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "More realistic lightning. Set pen size to set the size of the lightning.", ST_SOLID, TYPE_SOLID, &update_LIGH, &graphics_LIGH},
{"TESC", PIXPACK(0x707040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Tesla coil!", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, NULL, NULL},
{"DEST", PIXPACK(0xFF3311), -0.05f, 0.00f * CFDS, 0.95f, 0.95f, -0.1f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 1, 101, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 150, "More destructive Bomb.", ST_SOLID, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_DEST, &graphics_DEST},
- {"SPNG", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.", ST_SOLID, TYPE_SOLID, &update_SPNG, &graphics_SPNG},
+ {"SPNG", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 0.0f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.", ST_SOLID, TYPE_SOLID, &update_SPNG, &graphics_SPNG},
{"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, 100, SC_CRACKER2, 243.15f, 100, "Not quite Ice", ST_SOLID, TYPE_SOLID, &update_RIME, NULL},
{"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, 1, SC_CRACKER2, 243.15f, 100, "Not quite Steam", ST_GAS, TYPE_GAS|PROP_LIFE_DEC, &update_FOG, NULL},
{"BCLN", PIXPACK(0xFFD040), 0.0f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", ST_NONE, TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_BCLN, NULL},
diff --git a/src/powder.c b/src/powder.c
index 98f023a..9c684e9 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1816,8 +1816,11 @@ void update_particles_i(pixel *vid, int start, int inc)
pGravY += gravy[(y/CELL)*(XRES/CELL)+(x/CELL)];
}
//velocity updates for the particle
- parts[i].vx *= ptypes[t].loss;
- parts[i].vy *= ptypes[t].loss;
+ if (!(parts[i].flags&FLAG_MOVABLE))
+ {
+ parts[i].vx *= ptypes[t].loss;
+ parts[i].vy *= ptypes[t].loss;
+ }
//particle gets velocity from the vx and vy maps
parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL] + pGravX;
parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] + pGravY;
diff --git a/src/save.c b/src/save.c
index c56bdd3..a96cb05 100644
--- a/src/save.c
+++ b/src/save.c
@@ -2136,6 +2136,11 @@ int parse_save_PSv(void *save, int size, int replace, int x0, int y0, unsigned c
STKM_init_legs(&(fighters[fcount]), i-1);
}
}
+ else if (parts[i-1].type == PT_SPNG)
+ {
+ if (fabs(parts[i-1].vx)>0.0f || fabs(parts[i-1].vy)>0.0f)
+ parts[i-1].flags |= FLAG_MOVABLE;
+ }
if (ver<48 && (ty==OLD_PT_WIND || (ty==PT_BRAY&&parts[i-1].life==0)))
{