From ca7cfa9b4c5fbd487c9b5bcf9143cbfce35287e7 Mon Sep 17 00:00:00 2001 From: eska Date: Sun, 25 Oct 2015 23:13:46 +0100 Subject: [PATCH] Add all collision shapes to a tile when converting scenes to TileSets --- tools/editor/plugins/tile_set_editor_plugin.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/editor/plugins/tile_set_editor_plugin.cpp b/tools/editor/plugins/tile_set_editor_plugin.cpp index 39b0ef3c759..09115472a88 100644 --- a/tools/editor/plugins/tile_set_editor_plugin.cpp +++ b/tools/editor/plugins/tile_set_editor_plugin.cpp @@ -110,11 +110,15 @@ void TileSetEditor::_import_scene(Node *scene, Ref p_library, bool p_me if (!child2->cast_to()) continue; StaticBody2D *sb = child2->cast_to(); - if (sb->get_shape_count()==0) + int shape_count = sb->get_shape_count(); + if (shape_count==0) continue; - Ref collision=sb->get_shape(0); - if (collision.is_valid()) { - collisions.push_back(collision); + for (int shape_index=0; shape_index collision=sb->get_shape(shape_index); + if (collision.is_valid()) { + collisions.push_back(collision); + } } }