Thread: OMFG Help me for once -.-

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1 OMFG Help me for once -.- 
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    Code:
    Exception in thread "Thread-0" java.lang.NullPointerException
            at BloodScapeHaven.rs2.players.combat.PlayerCombat.attackPlayer(PlayerCom
    bat.java:345)
            at BloodScapeHaven.rs2.players.Player.process(Player.java:1489)
            at BloodScapeHaven.rs2.Engine.run(Engine.java:177)
            at java.lang.Thread.run(Unknown Source)
    Help .....

    line 345 in playercombat
    Code:
    int offsetX = (p.absX - p2.absX) * -1;
    player
    Code:
    if (attackingPlayer) {
                Engine.playerCombat.attackPlayer(this);
            }
    engine
    Code:
    p.process();

    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Jan 2008
    Posts
    2,340
    Thanks given
    20
    Thanks received
    575
    Rep Power
    1202
    Looks like a problem with projectiles
    Reply With Quote  
     

  3. #3  
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    I know that I can't fix it. Started happening after I added range so yeah only valid reason. But how do I fix it??

    Reply With Quote  
     

  4. #4  
    Sexy Donator
    Downfall's Avatar
    Join Date
    Oct 2008
    Age
    29
    Posts
    1,084
    Thanks given
    10
    Thanks received
    1
    Rep Power
    393
    have no idea soz mate :/ hope some one else can help you


    Did you know?
    - JaGeX has enough money to buy 8,000,000 tons of SuperCrack.
    Reply With Quote  
     

  5. #5  
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    Yeah so do I. My server is crashing like every 5 minutes because of this. I'll post part of the knife code(most people use them).
    Code:
    } else if (usingKnife(p.equipment[3])) {
                    p.stopMovement(p);
                    p.requestFaceTo(p2.playerId + 32768);
                    p.combatDelay = 2;
                    p.requestAnim(p.attackEmote, 0);
                    p.requestGFX(knifeThrow(p.equipment[3]), 100);
                    p.frames.createGlobalProjectile(p.absY, p.absX, offsetY, offsetX, knifeProjectile
    That's only part of it.

    Reply With Quote  
     

  6. #6  
    Registered Member
    Hotyute's Avatar
    Join Date
    Jan 2008
    Posts
    2,016
    Thanks given
    7
    Thanks received
    92
    Rep Power
    1482
    your attackPlayer is null

    do a check for nulls

    if (blah blah == null)
    return;


    Reply With Quote  
     

  7. #7  
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    If p = null? I already have that. This is horribly coded but here is my anti null code thing.
    Code:
    if (p.attackPlayer <= 0 || p.isDead || p.attackPlayer >= Engine.players.length 
                    || Engine.players[p.attackPlayer] == null || Engine.players[p.attackPlayer].isDead 
                    || p2.disconnected[1] || p == null) {
                        resetAttack(p);
                }

    Reply With Quote  
     

  8. #8  
    I_-_I
    Guest
    Quote Originally Posted by Goodoo Dolls View Post
    If p = null? I already have that. This is horribly coded but here is my anti null code thing.
    Code:
    if (p.attackPlayer <= 0 || p.isDead || p.attackPlayer >= Engine.players.length 
                    || Engine.players[p.attackPlayer] == null || Engine.players[p.attackPlayer].isDead 
                    || p2.disconnected[1] || p == null) {
                        resetAttack(p);
                }
    just paste the method containing
    Code:
    int offsetX = (p.absX - p2.absX) * -1;
    Reply With Quote  
     

  9. #9  
    Registered Member
    Hotyute's Avatar
    Join Date
    Jan 2008
    Posts
    2,016
    Thanks given
    7
    Thanks received
    92
    Rep Power
    1482
    Quote Originally Posted by Goodoo Dolls View Post
    If p = null? I already have that. This is horribly coded but here is my anti null code thing.
    Code:
    if (p.attackPlayer <= 0 || p.isDead || p.attackPlayer >= Engine.players.length 
                    || Engine.players[p.attackPlayer] == null || Engine.players[p.attackPlayer].isDead 
                    || p2.disconnected[1] || p == null) {
                        resetAttack(p);
                }
    nonoo ur p2


    Reply With Quote  
     

  10. #10  
    Meh. I can't code.

    Soulevoker's Avatar
    Join Date
    Sep 2007
    Age
    29
    Posts
    1,198
    Thanks given
    5
    Thanks received
    6
    Rep Power
    137
    Quote Originally Posted by Hotyute View Post
    nonoo ur p2
    It hasnt crashed yet. I'll do a quick test and see what happens. Also if you can help me, projectiles(range only) will randomly dc you. It wont crash the server but it will dc you. Its stupid. I was wondering if anyone might be of assistance.

    ---------- Post added at 01:32 PM ---------- Previous post was at 01:18 PM ----------

    Wow it still crashes wtf!

    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •