diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-12-19 09:55:01 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-12-19 09:58:02 -0300 |
commit | 1eb1837d0cf95c2c12d8ec51127e222f6f4888c5 (patch) | |
tree | 4dde3abbe494f244efdc5f308c8d97439a80d266 /modules/gridmap | |
parent | 49eea481ec962111f1436564096fdbe64d06de9c (diff) |
Should no longer crash after rebaking, may be a solution to #14795
Not sure if this is the same problem, as reported, please test.
Diffstat (limited to 'modules/gridmap')
-rw-r--r-- | modules/gridmap/grid_map.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 1860176f0c..060d9848ba 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -475,16 +475,17 @@ bool GridMap::_octant_update(const OctantKey &p_key) { xform.basis.set_orthogonal_index(c.rot); xform.set_origin(cellpos * cell_size + ofs); xform.basis.scale(Vector3(cell_scale, cell_scale, cell_scale)); + if (baked_meshes.size()) { + if (theme->get_item_mesh(c.item).is_valid()) { + if (!multimesh_items.has(c.item)) { + multimesh_items[c.item] = List<Pair<Transform, IndexKey> >(); + } - if (theme->get_item_mesh(c.item).is_valid()) { - if (!multimesh_items.has(c.item)) { - multimesh_items[c.item] = List<Pair<Transform, IndexKey> >(); + Pair<Transform, IndexKey> p; + p.first = xform; + p.second = E->get(); + multimesh_items[c.item].push_back(p); } - - Pair<Transform, IndexKey> p; - p.first = xform; - p.second = E->get(); - multimesh_items[c.item].push_back(p); } Vector<MeshLibrary::ShapeData> shapes = theme->get_item_shapes(c.item); |