Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neckro Null Object #126

Closed
jpw1991 opened this issue Mar 3, 2023 · 7 comments · Fixed by #131
Closed

Neckro Null Object #126

jpw1991 opened this issue Mar 3, 2023 · 7 comments · Fixed by #131
Assignees
Labels
bug Something isn't working

Comments

@jpw1991
Copy link
Owner

jpw1991 commented Mar 3, 2023

image

@jpw1991 jpw1991 added the bug Something isn't working label Mar 3, 2023
@CW-Jesse
Copy link
Collaborator

CW-Jesse commented Mar 3, 2023

What commit is this?

@jpw1991
Copy link
Owner Author

jpw1991 commented Mar 3, 2023

Newest master

@jpw1991
Copy link
Owner Author

jpw1991 commented Mar 3, 2023

I'm thinking it can only be _monsterAI:

        private Container GetNearestDropOffPoint() {
            // Container closestContainer;
            Container closestContainer = FindClosest<Container>(DropoffPointRadius.Value, pieceMask,
                c => c.GetInventory().GetEmptySlots() > 0);
            if (closestContainer == null) return null;
            
            // move toward that piece
            _monsterAI.SetFollowTarget(closestContainer.gameObject);
            return closestContainer;
        }
        ```

@CW-Jesse
Copy link
Collaborator

CW-Jesse commented Mar 3, 2023

It's a problem with the FindClosest method. Probably happens when no Containers or something. Thanks for finding this!

@CW-Jesse CW-Jesse self-assigned this Mar 3, 2023
@CW-Jesse
Copy link
Collaborator

CW-Jesse commented Mar 3, 2023

What's the NeckroStatus when this error occurs? Can't recreate the error by removing nearby containers.

@jpw1991
Copy link
Owner Author

jpw1991 commented Mar 4, 2023

It's a problem with the FindClosest method. Probably happens when no Containers or something. Thanks for finding this!

Maybe this line? .Where(t => t.GetComponent<ZNetView>().IsValid()) // TODO: explain

Perhaps no ZNetView is there

@jpw1991
Copy link
Owner Author

jpw1991 commented Mar 4, 2023

That seems to fix it for now, so I am going to release that as a hotfix and we can investigate better solutions later. Just gotta stop ppls games crashing etc.

@CW-Jesse CW-Jesse linked a pull request Mar 5, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants