Fixing crash when changing render distance #21

Open
nowinar wants to merge 1 commits from nowinar/fix-for-changing-render-distance into main
nowinar commented 2024-11-02 21:30:09 +00:00 (Migrated from github.com)

This fixes a bug in Planet.cpp which caused crash when lowering the render distance.
As of my observations, it is fixed by this commit.
It was caused by deleting from a map which we were iterating through.
The crash is shown in this screenshot:
image
And this is the call stack:

ScuffedMinecraft.exe!std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::pair<ChunkPos const ,ChunkData *>>>>::operator++() Line 160 C++
ScuffedMinecraft.exe!std::_List_iterator<std::_List_val<std::_List_simple_types<std::pair<ChunkPos const ,ChunkData *>>>>::operator++() Line 246 C++
ScuffedMinecraft.exe!Planet::ChunkThreadUpdate() Line 108 C++

This fixes a bug in Planet.cpp which caused crash when lowering the render distance. As of my observations, it is fixed by this commit. It was caused by deleting from a map which we were iterating through. The crash is shown in this screenshot: ![image](https://github.com/user-attachments/assets/357a9e21-6427-4ff8-b5e8-41b63d0294d2) And this is the call stack: > ScuffedMinecraft.exe!std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::pair<ChunkPos const ,ChunkData *>>>>::operator++() Line 160 C++ > ScuffedMinecraft.exe!std::_List_iterator<std::_List_val<std::_List_simple_types<std::pair<ChunkPos const ,ChunkData *>>>>::operator++() Line 246 C++ > ScuffedMinecraft.exe!Planet::ChunkThreadUpdate() Line 108 C++
fintmc commented 2024-11-05 16:14:44 +00:00 (Migrated from github.com)

LGTM

LGTM
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin nowinar/fix-for-changing-render-distance:nowinar/fix-for-changing-render-distance
git checkout nowinar/fix-for-changing-render-distance
Sign in to join this conversation.
No description provided.