summaryrefslogtreecommitdiff
path: root/src/simulation/elements/GEL.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-06-12 15:02:09 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-06-12 15:02:09 (GMT)
commit14cb5cf76511d1cede8c9f54d51dff4d75a46662 (patch)
treeec26380a9704a91f34982df106f903dc980606db /src/simulation/elements/GEL.cpp
parent96ec61644290aa026ffe6147954a5b1e20084f3f (diff)
downloadpowder-14cb5cf76511d1cede8c9f54d51dff4d75a46662.zip
powder-14cb5cf76511d1cede8c9f54d51dff4d75a46662.tar.gz
TPT: Gel won't move solids any more 68ab2e3148
Diffstat (limited to 'src/simulation/elements/GEL.cpp')
-rw-r--r--src/simulation/elements/GEL.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/simulation/elements/GEL.cpp b/src/simulation/elements/GEL.cpp
index 2d3baeb..274f7c1 100644
--- a/src/simulation/elements/GEL.cpp
+++ b/src/simulation/elements/GEL.cpp
@@ -98,8 +98,13 @@ int Element_GEL::update(UPDATE_FUNC_ARGS)
per *= 0.1;
dx *= per; dy *= per;
- parts[i].vx += dx; parts[r>>8].vx -= dx;
- parts[i].vy += dy; parts[r>>8].vy -= dy;
+ parts[i].vx += dx;
+ parts[i].vy += dy;
+ if ((sim->elements[r&0xFF].State!=ST_SOLID && sim->elements[r&0xFF].State!=ST_NONE) || (r&0xFF)==PT_GOO)
+ {
+ parts[r>>8].vx -= dx;
+ parts[r>>8].vy -= dy;
+ }
}
}
return 0;
@@ -120,4 +125,4 @@ int Element_GEL::graphics(GRAPHICS_FUNC_ARGS)
-Element_GEL::~Element_GEL() {} \ No newline at end of file
+Element_GEL::~Element_GEL() {}