Looks like a problem with projectiles
|
Help .....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)
line 345 in playercombatplayerCode:int offsetX = (p.absX - p2.absX) * -1;
engineCode:if (attackingPlayer) { Engine.playerCombat.attackPlayer(this); }Code:p.process();
Looks like a problem with projectiles
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).
That's only part of it.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
your attackPlayer is null
do a check for nulls
if (blah blah == null)
return;
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); }
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!
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |