Ok, just in case anyone was wondering, I think I've found where the error was, but I'm not 100% sure:
What I was trying to do: I shoot a ray from the player's coordinates to the mouse's coordinates. If the ray hits a tile, I compare the index of the tile at the hit coordinates with the index of the tile at the mouse's coordinates. If they are the same, I remove said tile.
The problem: Hitting any tile that was above the origin of the ray (the player's position) or to its left, resulted in an incorrect value for the index. The coordinates resulting from the raycast, for any right-wall hit seem to actually correspond to its right-side neighbor's left-wall. For any bottom-wall hit, the coordinates seem to correspond to its bottom-side neighbor's top-wall.
The solution: For now, I'm just checking the position of the origin point in relation to the end point, and substracting 1 to the corresponding resulting coordinate.
I thought it was a rounding issue with my "getTileIndex" function, and checking the dev branch of the FlxTilemap I found that now this function is implemented, so I replaced mine with the one in gitHub but that didn't solve it.
Is there a problem with ray() or am I doing something wrong?
Cheers,