summaryrefslogtreecommitdiff
path: root/scene/2d/tile_map.cpp
diff options
context:
space:
mode:
authorGilles Roudière <gilles.roudiere@gmail.com>2021-09-06 15:09:28 +0200
committerGitHub <noreply@github.com>2021-09-06 15:09:28 +0200
commitb0b30aaf41191ccbfdc8786cb79a76efb16d1459 (patch)
treef34a861c6bdfa5b88e4d275d9c7a5033eb2a954a /scene/2d/tile_map.cpp
parentd9b07faad2da7845b3a48115ac479900ab049f41 (diff)
parenta4cd553f42c8423c4d07b2115398689523b4dc50 (diff)
Merge pull request #52435 from groud/fix_crash_in_tilemap_physics
Fix crash in TileMap physics
Diffstat (limited to 'scene/2d/tile_map.cpp')
-rw-r--r--scene/2d/tile_map.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 13f1d258a8..729cc95bd7 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -1147,7 +1147,7 @@ void TileMap::_physics_create_quadrant(TileMapQuadrant *p_quadrant) {
PhysicsServer2D::get_singleton()->body_set_space(body, space);
Transform2D xform;
- xform.set_origin(map_to_world(p_quadrant->coords * get_effective_quadrant_size(layer)));
+ xform.set_origin(map_to_world(p_quadrant->coords * get_effective_quadrant_size(p_quadrant->layer)));
xform = global_transform * xform;
PhysicsServer2D::get_singleton()->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, xform);
}