From 0d977f5ee3fc824135a3fdbea8526d1d2e27f41f Mon Sep 17 00:00:00 2001 From: Josh Wilson Date: Wed, 16 Jan 2008 19:25:05 +0000 Subject: [PATCH] throwing an error in projectile interval if calcTimeOLastImpactOnPlane() fails --- direct/src/interval/ProjectileInterval.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/direct/src/interval/ProjectileInterval.py b/direct/src/interval/ProjectileInterval.py index 14941e3ea0..313bf9b7c0 100755 --- a/direct/src/interval/ProjectileInterval.py +++ b/direct/src/interval/ProjectileInterval.py @@ -195,8 +195,12 @@ class ProjectileInterval(Interval): # stop when we reach endZ self.startVel = calcStartVel(self.startPos, wayPoint, timeToWayPoint, self.zAcc) - self.duration = calcTimeOfLastImpactOnPlane( + time = calcTimeOfLastImpactOnPlane( self.startPos[2], endZ, self.startVel[2], self.zAcc) + if time is None: + self.notify.error( + 'projectile never reaches plane Z=%s' % endZ) + self.duration = time self.endPos = None else: self.notify.error('invalid set of inputs to ProjectileInterval')