Skip to content

Problem with terrain altering on borders #1

@renegadeandy

Description

@renegadeandy

Hi! I have some questions around this project -- not this version you have in Github but the version you shared with others here : https://drive.google.com/drive/folders/1t28wldbP_nkK5qRB9NOzSZMk7RtrONLK?usp=sharing

Can you help me out? I have added you on facebook in the hope we can have a chat about what I see?

The problem seems to stem whenever I click on a border chunk in a 3x3x3 set of chunks.

This bit of code appears to cause the issue :

 if (addChunks.Count > 0)
                {
                    for (int i = 0; i < addChunks.Count; i++)
                    {
                        GameObject g;
                        if ((g = GameObject.Find(mainHolder.GetNameFromCoord(addChunks[i]))) == null)
                        {
                            mainHolder.AddChuck(addChunks[i]);
                        }
                        else
                        {
                            Debug.Log("HOT RELOAD");
                            mainHolder.HotReloadChunk(addChunks[i], g.GetComponent<MeshChunk>());
                        }
                    }

                }

We check if the Chunk == null, and if it is, we add it to the main holder, which then causes a nullreferenceexception?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions