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:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sever goes unstable and crashes
Author Message
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #4
RE: Sever goes unstable and crashes
The passable function is really INSANE, it have up to 8k lines depending on the arg given!! hence up to 4k checks.

As I can see you are checking the Terrains to see if you can walk upon them or not, right? what about selecting terrain types using serv.map(x,y,z).type instead of .terrain and discarding the ones you don't want? something like ...

Code:
local.terrain=<serv.map(<eval <local.x>>,<eval <local.y>>,<argv4>).type>
local.passable=<qval (<local.terrain>==t_water || <local.terrain>==t_rock || <local.terrain>==t_lava) ?0:1>
You can add more checks there, even create new terrain types just to create a 'direct' check instead of 4k of them.

I would even better suggest you to create one definition per valid terrain, something like:

Code:
[defname valid_Terrains]
terrain_valid_1=1
terrain_valid_2=1
...
terrain_valid_22=1
...
terrain_valid_16383=1

and checking it via

Code:
local.passable=<def0.terrain_valid_<serv.map(<eval <local.x>>,<eval <local.y>>,<argv4>).terrain>>

rather than using that big one function (but I prefer the first option).
01-25-2015 07:32 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Sever goes unstable and crashes - Ankron - 01-25-2015, 06:14 PM
RE: Sever goes unstable and crashes - XuN - 01-25-2015, 06:20 PM
RE: Sever goes unstable and crashes - XuN - 01-25-2015 07:32 PM
RE: Sever goes unstable and crashes - XuN - 01-27-2015, 01:10 AM

Forum Jump:


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