Prevent crashes

This commit is contained in:
Daniel 2015-03-23 15:02:20 +02:00
parent 6ef7223997
commit c0f7d83b00
2 changed files with 6 additions and 5 deletions

View file

@ -437,15 +437,12 @@ class QuestPoster(DirectFrame):
invModel = loader.loadModel('phase_3.5/models/gui/inventory_icons') invModel = loader.loadModel('phase_3.5/models/gui/inventory_icons')
track1, track2 = quest.getChoices(base.localAvatar) track1, track2 = quest.getChoices(base.localAvatar)
if track1 is not None: lIconGeom = invModel.find('**/' + AvPropsNew[track1][1])
lIconGeom = invModel.find('**/' + AvPropsNew[track1][1])
if not fComplete: if not fComplete:
auxText = TTLocalizer.QuestPosterAuxOr auxText = TTLocalizer.QuestPosterAuxOr
lPos.setX(-0.18) lPos.setX(-0.18)
rIconGeom = invModel.find('**/' + AvPropsNew[track2][1])
if track2 is not None:
rIconGeom = invModel.find('**/' + AvPropsNew[track2][1])
infoText = TTLocalizer.QuestPageNameAndDestination % (toNpcName, infoText = TTLocalizer.QuestPageNameAndDestination % (toNpcName,
toNpcBuildingName, toNpcBuildingName,

View file

@ -1735,6 +1735,9 @@ class TrackChoiceQuest(Quest):
second = i second = i
break break
if first is None or second is None:
return (0, 1)
return (first, second) return (first, second)
def getCompletionStatus(self, av, questDesc, npc = None): def getCompletionStatus(self, av, questDesc, npc = None):
@ -4062,6 +4065,7 @@ class TrackTrainingReward(Reward):
def getTrack(self, av): def getTrack(self, av):
track = self.reward[0] track = self.reward[0]
if track == None: if track == None:
track = 0
trackAccess = av.getTrackAccess() trackAccess = av.getTrackAccess()
for i in xrange(len(trackAccess)): for i in xrange(len(trackAccess)):