mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
attempt to prevent a RockDebris effect that would otherwise crash the client
This commit is contained in:
parent
97d80a6d4b
commit
3d322b7394
@ -90,6 +90,7 @@ class ProjectileInterval(Interval):
|
|||||||
self.trajectoryArgs = args
|
self.trajectoryArgs = args
|
||||||
self.implicitStartPos = 1
|
self.implicitStartPos = 1
|
||||||
else:
|
else:
|
||||||
|
self.trajectoryArgs = args
|
||||||
self.__calcTrajectory(*args)
|
self.__calcTrajectory(*args)
|
||||||
|
|
||||||
Interval.__init__(self, name, self.duration)
|
Interval.__init__(self, name, self.duration)
|
||||||
@ -146,11 +147,11 @@ class ProjectileInterval(Interval):
|
|||||||
if type(time) == type([]):
|
if type(time) == type([]):
|
||||||
# projectile hits plane once going up, once going down
|
# projectile hits plane once going up, once going down
|
||||||
# assume they want the one on the way down
|
# assume they want the one on the way down
|
||||||
self.notify.debug('projectile hits plane twice at times: %s' %
|
assert self.notify.debug('projectile hits plane twice at times: %s' %
|
||||||
time)
|
time)
|
||||||
time = max(*time)
|
time = max(*time)
|
||||||
else:
|
else:
|
||||||
self.notify.debug('projectile hits plane once at time: %s' %
|
assert self.notify.debug('projectile hits plane once at time: %s' %
|
||||||
time)
|
time)
|
||||||
return time
|
return time
|
||||||
|
|
||||||
@ -213,17 +214,24 @@ class ProjectileInterval(Interval):
|
|||||||
self.endPos = self.__calcPos(self.duration)
|
self.endPos = self.__calcPos(self.duration)
|
||||||
|
|
||||||
# these are the parameters that we need to know:
|
# these are the parameters that we need to know:
|
||||||
self.notify.debug('startPos: %s' % `self.startPos`)
|
assert self.notify.debug('startPos: %s' % `self.startPos`)
|
||||||
self.notify.debug('endPos: %s' % `self.endPos`)
|
assert self.notify.debug('endPos: %s' % `self.endPos`)
|
||||||
self.notify.debug('duration: %s' % self.duration)
|
assert self.notify.debug('duration: %s' % self.duration)
|
||||||
self.notify.debug('startVel: %s' % `self.startVel`)
|
assert self.notify.debug('startVel: %s' % `self.startVel`)
|
||||||
self.notify.debug('z-accel: %s' % self.zAcc)
|
assert self.notify.debug('z-accel: %s' % self.zAcc)
|
||||||
|
|
||||||
|
|
||||||
def __initialize(self):
|
def __initialize(self):
|
||||||
if self.implicitStartPos:
|
if self.implicitStartPos:
|
||||||
self.__calcTrajectory(*self.trajectoryArgs)
|
self.__calcTrajectory(*self.trajectoryArgs)
|
||||||
|
|
||||||
|
def testTrajectory(self):
|
||||||
|
try:
|
||||||
|
self.__calcTrajectory(*self.trajectoryArgs)
|
||||||
|
except StandardError:
|
||||||
|
assert self.notify.error('invalid projectile parameters')
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def privInitialize(self, t):
|
def privInitialize(self, t):
|
||||||
self.__initialize()
|
self.__initialize()
|
||||||
if self.collNode:
|
if self.collNode:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user