| Tuesday, February 01, 2005 - 10:16 pm |
Using a radius of fire is very easy to do, but it might be heavy on the server.
bool MayFire(sPosition& dest, sPosition& orig, f32 radius)
if sqrt((dest.x - orig.x)*(dest.x - orig.x) + (dest.y - orig.y)*(dest.y - orig.y)) >= radius)
Simply use the callback MayFire with all available arms. Crude but it works. Of course there are several improvements that can be made, quadtrees for instance. Enumerating location by location retrieving distance and then check the arms stationed there and lots of variations.
Not hard, but is the 1000 or so database transactions worth it?