diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-17 16:48:12 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-17 16:48:12 (GMT) |
| commit | 89788d43c3c45bf0535b200a7703b91e0297208b (patch) | |
| tree | a0ed987576d1f911c10dc1ad4841358e8f8cb5f9 /src/elements/deut.cpp | |
| parent | df303dc4911c55031c74d30e13a58e02b27e7068 (diff) | |
| download | powder-89788d43c3c45bf0535b200a7703b91e0297208b.zip powder-89788d43c3c45bf0535b200a7703b91e0297208b.tar.gz | |
TPT: Make DEUT compress when Newtonian gravity is applied to it c960c29f72
Diffstat (limited to 'src/elements/deut.cpp')
| -rw-r--r-- | src/elements/deut.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/elements/deut.cpp b/src/elements/deut.cpp index cee38de..e5efe53 100644 --- a/src/elements/deut.cpp +++ b/src/elements/deut.cpp @@ -2,9 +2,13 @@ int update_DEUT(UPDATE_FUNC_ARGS) { int r, rx, ry, trade, np; + float gravtot = fabs(sim->gravy[(y/CELL)*(XRES/CELL)+(x/CELL)])+fabs(sim->gravx[(y/CELL)*(XRES/CELL)+(x/CELL)]); int maxlife = ((10000/(parts[i].temp + 1))-1); if ((10000%((int)parts[i].temp+1))>rand()%((int)parts[i].temp+1)) maxlife ++; + // Compress when Newtonian gravity is applied + // multiplier=1 when gravtot=0, multiplier -> 5 as gravtot -> inf + maxlife = maxlife*(5.0f - 8.0f/(gravtot+2.0f)); if (parts[i].life < maxlife) { for (rx=-1; rx<2; rx++) |
