Background info:
I am using a tilemap layer to keep track of available tiles. This way I can also toggle the visibility of that layer to show the player what tiles are available.
When I delete a tile I use the this function:
func clear_tile(tile):
get_node("TileMap").set_cell(3, tile, 2, Vector2i.ZERO)
which causes this error:
Condition "!Q" is true.
<C++ Source> scene/2d/tile_map.cpp:2100 @ set_cell()
which relates to this part of engine code:
https://github.com/godotengine/godot/blob/92bee43adba8d2401ef40e2480e53087bcb1eaf1/scene/2d/tile_map.cpp#L2100
As far as I can see I am using the set_cell function correctly, and I don't understand why this error is thrown. I get *when* the error is thrown, just not *why* the programmers decided it is needed. I am doing exactly the same as the function
void TileMap::erase_cell(int p_layer, const Vector2i &p_coords)
which also throws the same error.
Question:
What is the "!Q is true" error for and will it actually cause any problems?
Note:
I know there are ways I can avoid needing to erase tiles (like making the tiles transparent instead), but I think my current solution is good for simplicity and code clarity.