mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 04:06:14 +00:00
Merge pull request #40327 from pkdawson/patch-1
Avoid overflow when calculating visible_cells
This commit is contained in:
commit
2921827387
@ -211,7 +211,7 @@ struct SpatialIndexer2D {
|
||||
List<VisibilityNotifier2D *> added;
|
||||
List<VisibilityNotifier2D *> removed;
|
||||
|
||||
int visible_cells = (end.x - begin.x) * (end.y - begin.y);
|
||||
uint64_t visible_cells = (uint64_t)(end.x - begin.x) * (uint64_t)(end.y - begin.y);
|
||||
|
||||
if (visible_cells > 10000) {
|
||||
//well you zoomed out a lot, it's your problem. To avoid freezing in the for loops below, we'll manually check cell by cell
|
||||
|
Loading…
Reference in New Issue
Block a user