What Myrkling suggests is that you check if the imaginary line from the mouse cursor to some hypothetical position far in front of the mouse cursor, and check if and where it intersects with your grid.

If you also want to check if an entity is hit, you should first c_trace() along the line and if it hits nothing fall back to the intersection check.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com