The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Distance @timer
Author Message
Rizz
Master
**

Posts: 396
Likes Given: 21
Likes Received: 14 in 9 posts
Joined: Oct 2012
Reputation: 0



Post: #6
RE: Distance @timer
I decided to fix in this way:

Code:
[FUNCTION f_magery_target_distance]
ref1=<args>
// serv.b names <name> <ref1.name>
// serv.b distance <ref1.distance>
LOCAL.deltax=<eval <ref1.p.x>-<p.x>>
LOCAL.deltay=<eval <ref1.p.y>-<p.y>>
serv.b components <dLOCAL.deltax> <dLOCAL.deltay>
LOCAL.sum=(<LOCAL.deltax>*<LOCAL.deltax>) + (<LOCAL.deltay>*<LOCAL.deltay>)
LOCAL.hdistance=<eval SQRT(<LOCAL.sum>)>
serv.b handmade distance <dLOCAL.hdistance>


Normal distance and distance found in that way is almost the same but sometimes they have a difference of 1 tile.
Is a truncation problem?
How sphere calculates it?

Is just a difference between p.x and p.y and you take the biggest one?
(This post was last modified: 04-27-2015 06:04 AM by Rizz.)
04-27-2015 05:22 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Distance @timer - Rizz - 04-26-2015, 06:29 AM
RE: Distance @timer - Coruja - 04-26-2015, 07:49 AM
RE: Distance @timer - Rizz - 04-26-2015, 08:09 AM
RE: Distance @timer - XuN - 04-27-2015, 02:56 AM
RE: Distance @timer - Rizz - 04-27-2015, 03:43 AM
RE: Distance @timer - Rizz - 04-27-2015 05:22 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)