diff --git a/otp/distributed/OTPClientRepository.py b/otp/distributed/OTPClientRepository.py index 7e08bd2b..100b365e 100644 --- a/otp/distributed/OTPClientRepository.py +++ b/otp/distributed/OTPClientRepository.py @@ -1899,10 +1899,12 @@ class OTPClientRepository(ClientRepositoryBase): pass def identifyAvatar(self, doId): - if self.doId2do.has_key(doId): - return self.doId2do[doId] + info = self.doId2do.get(doId) + if info: + return info else: - return self.identifyFriend(doId) + info = self.identifyFriend(doId) + return info def sendDisconnect(self): if self.isConnected(): diff --git a/otp/friends/PlayerFriendsManager.py b/otp/friends/PlayerFriendsManager.py index 7c045806..e7dabafa 100644 --- a/otp/friends/PlayerFriendsManager.py +++ b/otp/friends/PlayerFriendsManager.py @@ -251,7 +251,7 @@ class PlayerFriendsManager(DistributedObjectGlobal): return returnList def identifyAvatar(self, doId): - if base.cr.doId2do.has_key(doId) + if doId in base.cr.doId2do: return base.cr.doId2do[doId] else: return self.identifyFriend(doId) diff --git a/toontown/distributed/ToontownClientRepository.py b/toontown/distributed/ToontownClientRepository.py index 074e8738..24cda8b4 100644 --- a/toontown/distributed/ToontownClientRepository.py +++ b/toontown/distributed/ToontownClientRepository.py @@ -679,11 +679,11 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): self.friendsMap[avatar.doId] = avatar def identifyFriend(self, doId, source = None): - if self.friendsMap.has_key(doId): + if doId in self.friendsMap: teleportNotify.debug('friend %s in friendsMap' % doId) return self.friendsMap[doId] avatar = None - if self.doId2do.has_key(doId): + if doId in self.doId2do: teleportNotify.debug('found friend %s in doId2do' % doId) avatar = self.doId2do[doId] elif self.cache.contains(doId): @@ -716,7 +716,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): return base.cr.playerFriendsManager.getFriendInfo(pId) def identifyAvatar(self, doId): - if self.doId2do.has_key(doId): + if doId in self.doId2do: return self.doId2do[doId] else: return self.identifyFriend(doId)