22.02.2014, 05:38
Instead of a check against 1000 units of distance, why don't you search for the closest hospital within THEMSELVES? Use sorting techniques or make your own, it's not difficult!
1) Get distance of each hospital from player
2) In a loop, get the smallest distance at index 0 by sorting (or simply temp vars)
3) Spawn at gArray[ 0 ][ 0 ]....
1) Get distance of each hospital from player
2) In a loop, get the smallest distance at index 0 by sorting (or simply temp vars)
3) Spawn at gArray[ 0 ][ 0 ]....