DANIEL: Crash fixes

This commit is contained in:
John 2015-06-06 22:26:09 +03:00 committed by Loudrob
parent 0aab15cb8c
commit 7a9da93d39
4 changed files with 8 additions and 13 deletions

View file

@ -4,6 +4,7 @@ from pandac.PandaModules import *
from direct.gui.DirectScrolledList import *
from toontown.toonbase import ToontownGlobals
from toontown.toontowngui import TTDialog
from toontown.friends import FriendHandle
import CatalogItem
import CatalogInvalidItem
import CatalogFurnitureItem
@ -1024,7 +1025,8 @@ class CatalogScreen(DirectFrame):
def __makeFFlist(self):
for id, handle in base.cr.friendsMap.items():
self.ffList.append((id, handle.getName(), NametagGlobals.getFriendColor(handle)))
if isinstance(handle, FriendHandle.FriendHandle):
self.ffList.append((id, handle.getName(), NametagGlobals.getFriendColor(handle)))
def __makeScrollList(self):
for ff in self.ffList:

View file

@ -175,8 +175,6 @@ class DistributedPhone(DistributedFurnitureItem.DistributedFurnitureItem):
return
if self.hasLocalAvatar:
self.freeAvatar()
if config.GetBool('want-pets', 1):
base.localAvatar.lookupPetDNA()
self.notify.debug('Entering Phone Sphere....')
taskMgr.remove(self.uniqueName('ringDoLater'))
self.ignore(self.phoneSphereEnterEvent)

View file

@ -108,7 +108,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
self.savedCheesyExpireTime = 0
if hasattr(base, 'wantPets') and base.wantPets:
self.petTrickPhrases = []
self.petDNA = None
self.customMessages = []
self.resistanceMessages = []
self.cogSummonsEarned = []
@ -1662,11 +1661,8 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
def setPetId(self, petId):
self.petId = petId
if petId == 0:
self.petDNA = None
elif self.isLocal():
if self.isLocal():
base.cr.addPetToFriendsMap()
return
def getPetId(self):
return self.petId
@ -1722,6 +1718,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
def __petDetailsLoaded(self, pet):
self.petDNA = pet.style
def trickOrTreatTargetMet(self, beanAmount):
if self.effect:
self.effect.stop()

View file

@ -1768,13 +1768,11 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
def getPetDNA(self):
if self.hasPet():
pet = base.cr.doId2do(self.petId)
return pet.petDNA
pet = base.cr.identifyFriend(self.petId)
return pet.style if pet else None
return None
def setPetId(self, petId):
self.petId = petId
if petId == 0:
self.petDNA = None
elif self.isLocal():
if self.isLocal():
base.cr.addPetToFriendsMap()