From e2dd0c101ef93cb2f0d5dac4082a4ac25c83a0bd Mon Sep 17 00:00:00 2001 From: Samuele Zolfanelli Date: Mon, 8 Apr 2019 23:38:31 +0200 Subject: Make TileMap overridable "set_cell" function called on undo/redo --- scene/2d/tile_map.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scene') diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 3562011bc2..79bcd5fede 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -749,7 +749,10 @@ void TileMap::set_cellv(const Vector2 &p_pos, int p_tile, bool p_flip_x, bool p_ void TileMap::_set_celld(const Vector2 &p_pos, const Dictionary &p_data) { - set_cell(p_pos.x, p_pos.y, p_data["id"], p_data["flip_h"], p_data["flip_y"], p_data["transpose"], p_data["auto_coord"]); + Variant v_pos_x = p_pos.x, v_pos_y = p_pos.y, v_tile = p_data["id"], v_flip_h = p_data["flip_h"], v_flip_v = p_data["flip_y"], v_transpose = p_data["transpose"], v_autotile_coord = p_data["auto_coord"]; + const Variant *args[7] = { &v_pos_x, &v_pos_y, &v_tile, &v_flip_h, &v_flip_v, &v_transpose, &v_autotile_coord }; + Variant::CallError ce; + call("set_cell", args, 7, ce); } void TileMap::set_cell(int p_x, int p_y, int p_tile, bool p_flip_x, bool p_flip_y, bool p_transpose, Vector2 p_autotile_coord) { -- cgit v1.2.3