Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock DiagonalRoute(Float:nx, Float:ny, Float: nz, Float:px, Float:py, Float:pz) {
- if(floatround(nz) != floatround(pz)) {
- return false;
- }
- if((nx > px)) {
- while(nx > px) {
- nx -= 1.0;
- while(ny > py) {
- ny -= 1.0;
- MapAndreas_FindZ_For2DCoord(nx, ny, nz);
- if(floatabs((nz) - (pz)) > 2.5) {
- return false;
- }
- }
- while(ny < py) {
- ny += 1.0;
- MapAndreas_FindZ_For2DCoord(nx, ny, nz);
- if(floatabs((nz) - (pz)) > 2.5) {
- return false;
- }
- }
- }
- }
- else {
- while(nx < px) {
- nx += 1.0;
- while(ny > py) {
- ny -= 1.0;
- MapAndreas_FindZ_For2DCoord(nx, ny, nz);
- if(floatabs((nz) - (pz)) > 2.5) {
- return false;
- }
- }
- while(ny < py) {
- ny += 1.0;
- MapAndreas_FindZ_For2DCoord(nx, ny, nz);
- if(floatabs((nz) - (pz)) > 2.5) {
- return false;
- }
- }
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement