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 direct.gui.DirectScrolledList import *
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.toontowngui import TTDialog from toontown.toontowngui import TTDialog
from toontown.friends import FriendHandle
import CatalogItem import CatalogItem
import CatalogInvalidItem import CatalogInvalidItem
import CatalogFurnitureItem import CatalogFurnitureItem
@ -1024,7 +1025,8 @@ class CatalogScreen(DirectFrame):
def __makeFFlist(self): def __makeFFlist(self):
for id, handle in base.cr.friendsMap.items(): 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): def __makeScrollList(self):
for ff in self.ffList: for ff in self.ffList:

View file

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

View file

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

View file

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