at server.model.npcs.PetHandler.pickupPet(PetHandler. java:98)
post the code around that line highlighting the code on line 98
|
Added this: https://www.rune-server.ee/runescape...enums-etc.html
When i pickup my pet(s) i get this error and the pet doesnt pickup
Code:[11/9/18 8:41 AM]: java.lang.NullPointerException [11/9/18 8:41 AM]: at server.model.npcs.PetHandler.pickupPet(PetHandler.java:98) [11/9/18 8:41 AM]: at server.model.players.ActionHandler.firstClickNpc(ActionHandler.java:1138) [11/9/18 8:41 AM]: at server.model.players.packets.ClickNPC.processPacket(ClickNPC.java:174) [11/9/18 8:41 AM]: at server.model.players.PacketHandler.processPacket(PacketHandler.java:139) [11/9/18 8:41 AM]: at server.model.players.Client.processQueuedPackets(Client.java:1222) [11/9/18 8:41 AM]: at server.model.players.PlayerHandler.process(PlayerHandler.java:144) [11/9/18 8:41 AM]: at server.Server$1.execute(Server.java:161) [11/9/18 8:41 AM]: at server.task.Task.execute(Task.java:21) [11/9/18 8:41 AM]: at server.task.Executor.executeRemainingTasks(Executor.java:100) [11/9/18 8:41 AM]: at server.task.Executor.access$1(Executor.java:79) [11/9/18 8:41 AM]: at server.task.Executor$1.run(Executor.java:63) [11/9/18 8:41 AM]: at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [11/9/18 8:41 AM]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [11/9/18 8:41 AM]: at java.lang.Thread.run(Unknown Source)
at server.model.npcs.PetHandler.pickupPet(PetHandler. java:98)
post the code around that line highlighting the code on line 98
Code:public static boolean pickupPet(Client c, int npcId) { Pets pets = forNpc(npcId); if(pets != null) { if(Server.npcHandler.npcs[c.rememberNpcIndex].spawnedBy == c.playerId) { int itemId = pets.itemId; if(c.getItems().freeSlots() > 0) { Server.npcHandler.npcs[c.rememberNpcIndex].absX = 0; Server.npcHandler.npcs[c.rememberNpcIndex].absY = 0; Server.npcHandler.npcs[c.rememberNpcIndex] = null; c.startAnimation(827); c.getItems().addItem(itemId, 1); c.summonId = -1; c.hasNpc = false; c.sendMessage("You pick up your pet."); } else { c.sendMessage("You do not have enough inventory space to do this."); } } else { c.sendMessage("This is not your pet."); } return true; } else { return false; } }
Server.npcHandler.npcs[c.rememberNpcIndex] is null so its likely that c.rememberNpcIndex is incorrect when you spawned the pet
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |