aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/path.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/path.c b/src/path.c
index 340f8c7..85233d6 100644
--- a/src/path.c
+++ b/src/path.c
@@ -84,7 +84,10 @@ path *path_init(double *pos, double *dir, double T0, double range, double theta0
dz[i] = (s[i]-s[i-1])*cos(theta);
/* Calculate total energy */
- t[i] = t[i-1] + (s[i]-s[i-1])/(beta[i]*SPEED_OF_LIGHT);
+ if (beta[i] > 0)
+ t[i] = t[i-1] + (s[i]-s[i-1])/(beta[i]*SPEED_OF_LIGHT);
+ else
+ t[i] = t[i-1];
x[i] = x[i-1] + dx[i];
y[i] = y[i-1] + dy[i];