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:
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:
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.
What is the "!Q is true" error for and will it actually cause any problems?
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.