summaryrefslogtreecommitdiff
path: root/src/simulation/elements/dcel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/elements/dcel.cpp')
-rw-r--r--src/simulation/elements/dcel.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/simulation/elements/dcel.cpp b/src/simulation/elements/dcel.cpp
index 07f930b..294c840 100644
--- a/src/simulation/elements/dcel.cpp
+++ b/src/simulation/elements/dcel.cpp
@@ -62,8 +62,17 @@ int Element_DCEL::update(UPDATE_FUNC_ARGS)
continue;
if(sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))
{
- parts[r>>8].vx *= 0.9f;
- parts[r>>8].vy *= 0.9f;
+ if (parts[i].ctype)
+ {
+ int change = parts[i].ctype > 100 ? 100 : parts[i].ctype < 0 ? 0 : parts[i].ctype;
+ parts[r>>8].vx *= 1-change/100.0f;
+ parts[r>>8].vy *= 1-change/100.0f;
+ }
+ else
+ {
+ parts[r>>8].vx *= 0.9f;
+ parts[r>>8].vy *= 0.9f;
+ }
parts[i].tmp = 1;
}
}