Thread: Random Error

Results 1 to 6 of 6
  1. #1 Random Error 
    Banned

    Join Date
    Apr 2012
    Age
    27
    Posts
    2,936
    Thanks given
    1,126
    Thanks received
    1,081
    Rep Power
    0
    This happens after server has been on awhile:

    Code:
    java.lang.NullPointerException
            at game.npc.NPCHandler.getCloseRandomPlayer(NPCHandler.java:2107)
            at game.npc.NPCHandler.process(NPCHandler.java:3650)
            at game.Server$2.execute(Server.java:165)
            at engine.event.Task.tick(Task.java:103)
            at engine.event.TaskScheduler.run(TaskScheduler.java:98)
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
            at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
    
            at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
    access$301(Unknown Source)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
    run(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)
    Line that messes up

    Code:
    if (p.heightLevel == NPCHandler.npcs[i].heightLevel) {
    the method:

    Code:
    public int getCloseRandomPlayer(final int i) {
            final ArrayList < Integer > players = new ArrayList < Integer > ();
            for (int j = 0; j < PlayerHandler.players.length; j++) {
                if (PlayerHandler.players[j] != null) {
                    if (goodDistance(PlayerHandler.players[j].absX, PlayerHandler.players[j].absY, NPCHandler.npcs[i].absX, NPCHandler.npcs[i].absY, 2 + distanceRequired(i) + followDistance(i)) || isFightCaveNpc(i)) {
                        if (PlayerHandler.players[j].underAttackBy <= 0 && PlayerHandler.players[j].underAttackBy2 <= 0 || PlayerHandler.players[j].inMulti()) {
                        	for (final Player p : PlayerHandler.players){
    	                    	if (p.heightLevel == NPCHandler.npcs[i].heightLevel) {
    	                            players.add(j);
    	                        }
                        	}
                        }
                    }
                }
            }
            if (players.size() > 0) {
                return players.get(Misc.random(players.size() - 1));
            } else {
                return 0;
            }
        }
    and the npchandler line 3650:

    Code:
    if (isAggressive(i) && !npcs[i].underAttack && !npcs[i].isDead && !switchesAttackers(i)) {
    					npcs[i].killerId = getCloseRandomPlayer(i);
    				} else if (isAggressive(i) && !npcs[i].underAttack && !npcs[i].isDead && switchesAttackers(i)) {
    					npcs[i].killerId = getCloseRandomPlayer(i);
    				}
    This also happens with getClosePlayer
    Reply With Quote  
     

  2. #2  
    Web, App and game dev
    marciano's Avatar
    Join Date
    Jul 2009
    Posts
    588
    Thanks given
    11
    Thanks received
    28
    Rep Power
    2
    hmm, just after a while, and not just on the same location over and over again?
    Fuck the bully's always have self confidence, and have fun in life!

    Spoiler for QOUTES:

    Quote Originally Posted by Faris View Post
    There is no real age limit on learning something new, if you want to do it, then do it.


    Spoiler for VOUCHES:

    Quote Originally Posted by vish View Post
    Vouch, great help and highly professional.
    Quote Originally Posted by Titanium View Post
    Vouch for vbulletin 4.2 postbit backgrounds.
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Apr 2012
    Age
    27
    Posts
    2,936
    Thanks given
    1,126
    Thanks received
    1,081
    Rep Power
    0
    Quote Originally Posted by marciano View Post
    hmm, just after a while, and not just on the same location over and over again?
    nop.
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Apr 2012
    Age
    27
    Posts
    2,936
    Thanks given
    1,126
    Thanks received
    1,081
    Rep Power
    0
    bump
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Nov 2011
    Posts
    134
    Thanks given
    6
    Thanks received
    1
    Rep Power
    11
    I have the same problem on a different line :/
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Aug 2012
    Posts
    303
    Thanks given
    2
    Thanks received
    58
    Rep Power
    0
    I've had this same error before... I don't know what it is really..
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Random error
    By Soulevoker in forum Help
    Replies: 3
    Last Post: 11-17-2009, 08:06 PM
  2. Random error?
    By pureiiipker in forum Help
    Replies: 2
    Last Post: 08-27-2009, 08:13 AM
  3. Random error
    By Sicc in forum Help
    Replies: 10
    Last Post: 08-15-2009, 06:19 PM
  4. random error...
    By luvgirl12345 in forum Help
    Replies: 1
    Last Post: 07-03-2009, 12:48 PM
  5. random error
    By cavallers in forum Help
    Replies: 9
    Last Post: 04-09-2009, 10:50 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •