coghq: fix more cj crashes
This commit is contained in:
parent
cf68a25f81
commit
747fff520c
1 changed files with 3 additions and 12 deletions
|
@ -9,6 +9,7 @@ from toontown.estate import DistributedCannon
|
||||||
from toontown.estate import CannonGlobals
|
from toontown.estate import CannonGlobals
|
||||||
from direct.gui.DirectGui import *
|
from direct.gui.DirectGui import *
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
|
from libotp import *
|
||||||
from toontown.toon import NPCToons
|
from toontown.toon import NPCToons
|
||||||
from toontown.toon import ToonHead
|
from toontown.toon import ToonHead
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
|
@ -667,12 +668,7 @@ class DistributedLawbotCannon(DistributedObject.DistributedObject):
|
||||||
avId = task.avId
|
avId = task.avId
|
||||||
if self.toonHead == None or not self.boss.state == 'BattleTwo':
|
if self.toonHead == None or not self.boss.state == 'BattleTwo':
|
||||||
return Task.done
|
return Task.done
|
||||||
flightResults = self.__calcFlightResults(avId, launchTime)
|
startPos, startHpr, startVel, trajectory, timeOfImpact, hitWhat = self.__calcFlightResults(avId, launchTime)
|
||||||
if not isClient():
|
|
||||||
print('EXECWARNING DistributedLawbotCannon: %s' % flightResults)
|
|
||||||
printStack()
|
|
||||||
for key in flightResults:
|
|
||||||
exec("%s = flightResults['%s']" % (key, key))
|
|
||||||
|
|
||||||
self.notify.debug('start position: ' + str(startPos))
|
self.notify.debug('start position: ' + str(startPos))
|
||||||
self.notify.debug('start velocity: ' + str(startVel))
|
self.notify.debug('start velocity: ' + str(startVel))
|
||||||
|
@ -744,12 +740,7 @@ class DistributedLawbotCannon(DistributedObject.DistributedObject):
|
||||||
trajectory = Trajectory.Trajectory(launchTime, startPos, startVel)
|
trajectory = Trajectory.Trajectory(launchTime, startPos, startVel)
|
||||||
self.trajectory = trajectory
|
self.trajectory = trajectory
|
||||||
timeOfImpact, hitWhat = self.__calcToonImpact(trajectory)
|
timeOfImpact, hitWhat = self.__calcToonImpact(trajectory)
|
||||||
return {'startPos': startPos,
|
return startPos, startHpr, startVel, trajectory, 3 * timeOfImpact, hitWhat
|
||||||
'startHpr': startHpr,
|
|
||||||
'startVel': startVel,
|
|
||||||
'trajectory': trajectory,
|
|
||||||
'timeOfImpact': 3 * timeOfImpact,
|
|
||||||
'hitWhat': hitWhat}
|
|
||||||
|
|
||||||
def __calcToonImpact(self, trajectory):
|
def __calcToonImpact(self, trajectory):
|
||||||
t_groundImpact = trajectory.checkCollisionWithGround(GROUND_PLANE_MIN)
|
t_groundImpact = trajectory.checkCollisionWithGround(GROUND_PLANE_MIN)
|
||||||
|
|
Loading…
Reference in a new issue