22.02.2014, 06:07
Quote:
Create 2 more checks that will check if he is in range at 100 or something for each hospital, if is not then will check with the code that you have above. This is will be a possible fix I think, not that great, but something untill you find the main problem.
|
Quote:
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 ].... |