From c960c29f7264b2a56b7aec97a1777915c8207d72 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sat, 18 Feb 2012 23:12:42 +0000 Subject: [PATCH] Make DEUT compress when Newtonian gravity is applied to it --- src/elements/deut.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/elements/deut.c b/src/elements/deut.c index 9276de17b..728953815 100644 --- a/src/elements/deut.c +++ b/src/elements/deut.c @@ -2,9 +2,13 @@ int update_DEUT(UPDATE_FUNC_ARGS) { int r, rx, ry, trade, np; + float gravtot = fabs(gravy[(y/CELL)*(XRES/CELL)+(x/CELL)])+fabs(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++)