From c79f5498e1c22f291ce77fa5520fe2661a7d4bbb Mon Sep 17 00:00:00 2001 From: Loudrob Date: Sun, 29 Mar 2015 11:55:35 -0400 Subject: [PATCH] Revert "Potential street teleport fix" This reverts commit e0ea00b3bd6f5a3d585338a47599f3da642126b8. --- otp/distributed/OTPClientRepository.py | 8 +++++--- otp/friends/PlayerFriendsManager.py | 2 +- toontown/distributed/ToontownClientRepository.py | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) 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)