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')
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:
auxText = TTLocalizer.QuestPosterAuxOr
lPos.setX(-0.18)
if track2 is not None:
rIconGeom = invModel.find('**/' + AvPropsNew[track2][1])
rIconGeom = invModel.find('**/' + AvPropsNew[track2][1])
infoText = TTLocalizer.QuestPageNameAndDestination % (toNpcName,
toNpcBuildingName,

View file

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