nate97 / src

An opensource Toontown game source code.
4 stars 2 forks source link

'NoneType' object has no attribute 'storeObjectLocation' #1

Open nate97 opened 6 years ago

nate97 commented 6 years ago

When entering a new location, such as a tunnel the (setLocation function) located in DistributedPlayer.py is called, on line 93: DistributedAvatar.DistributedAvatar.setLocation(self, parentId, zoneId) is called, however self.cr is undefined, this function works when logging in and loading the playground initially however not when entering a new location. forwhatever reason self.cr is not being defined, I don't know if I can explain this any better as I'm not the best at Python.

Code: otp/avatar/DistributedPlayer.py

def setLocation(self, parentId, zoneId):
    DistributedAvatar.DistributedAvatar.setLocation(self, parentId, zoneId)
    if not (parentId in (0, None) and zoneId in (0, None)):
        if not self.cr._isValidPlayerLocation(parentId, zoneId):
            self.cr.disableDoId(self.doId)
            self.cr.deleteObject(self.doId)
    return None

Traceback:

File "otp/avatar/DistributedPlayer.py", line 93, in setLocation DistributedAvatar.DistributedAvatar.setLocation(self, parentId, zoneId) File "/usr/share/panda3d/direct/distributed/DistributedNode.py", line 49, in setLocation DistributedObject.DistributedObject.setLocation(self, parentId, zoneId) File "/usr/share/panda3d/direct/distributed/DistributedObject.py", line 497, in setLocation self.cr.storeObjectLocation(self, parentId, zoneId) AttributeError: 'NoneType' object has no attribute 'storeObjectLocation'

nosyliam commented 6 years ago

I've experienced this issue before and I believe it's an issue with your Astron build. Which version/commit of Astron are you using? You can check by running the command astrond -v

nate97 commented 6 years ago

Hi nosyliam! It outputs that I am running revision a7b91fd1, If I'm not mistaken I believe that's the latest version of Astron

nate97 commented 6 years ago

I've tried compiling Astron 0.1.0 from the release section, that has "fixed" the issue, at least in the short term. I hope to eventually update the code to run with the latest version of Astron, but it looks like that's going to an interesting task, and isn't necessary immediately.

nosyliam commented 6 years ago

Anything before 3b8f7595 will work as it causes a regression which disables the client. I haven't looked into it, so you should 100% make an issue on Astron.

nate97 commented 6 years ago

Alright, I will do so soon, thank you so much!

Linkshanderin commented 6 years ago

Has this been followed up upon yet?