Skip to content
Snippets Groups Projects
Commit d5c9889b authored by Rumen Nikiforov's avatar Rumen Nikiforov
Browse files

BETA: Fixing little NPE since [9154] seems like we missed to set summoner in some places.

	* Reported by: valdaron
parent 7e1aae8f
No related branches found
No related tags found
No related merge requests found
...@@ -79,13 +79,14 @@ public class ChristmasTree extends AbstractNpcAI ...@@ -79,13 +79,14 @@ public class ChristmasTree extends AbstractNpcAI
{ {
L2Skill skill = _holder.getSkill(); L2Skill skill = _holder.getSkill();
final L2PcInstance player = _npc.getSummoner().getActingPlayer(); if (_npc.getSummoner() == null || !_npc.getSummoner().isPlayer())
if (player == null)
{ {
ThreadPoolManager.getInstance().scheduleGeneral(this, 1000); ThreadPoolManager.getInstance().scheduleGeneral(this, 1000);
return; return;
} }
final L2PcInstance player = _npc.getSummoner().getActingPlayer();
if (!player.isInParty()) if (!player.isInParty())
{ {
if (player.isInsideRadius(_npc, skill.getSkillRadius(), true, true)) if (player.isInsideRadius(_npc, skill.getSkillRadius(), true, true))
......
...@@ -18,6 +18,7 @@ import com.l2jserver.gameserver.datatables.NpcTable; ...@@ -18,6 +18,7 @@ import com.l2jserver.gameserver.datatables.NpcTable;
import com.l2jserver.gameserver.handler.IItemHandler; import com.l2jserver.gameserver.handler.IItemHandler;
import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.L2Spawn; import com.l2jserver.gameserver.model.L2Spawn;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
...@@ -62,7 +63,8 @@ public class ChristmasTree implements IItemHandler ...@@ -62,7 +63,8 @@ public class ChristmasTree implements IItemHandler
spawn.setLocy(target.getY()); spawn.setLocy(target.getY());
spawn.setLocz(target.getZ()); spawn.setLocz(target.getZ());
spawn.setInstanceId(activeChar.getInstanceId()); spawn.setInstanceId(activeChar.getInstanceId());
spawn.spawnOne(false); L2Npc npc = spawn.spawnOne(false);
npc.setSummoner(activeChar);
activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false); activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);
......
...@@ -122,6 +122,7 @@ public class SummonItems implements IItemHandler ...@@ -122,6 +122,7 @@ public class SummonItems implements IItemHandler
spawn.setInstanceId(activeChar.getInstanceId()); spawn.setInstanceId(activeChar.getInstanceId());
spawn.stopRespawn(); spawn.stopRespawn();
final L2Npc npc = spawn.spawnOne(true); final L2Npc npc = spawn.spawnOne(true);
npc.setSummoner(activeChar);
npc.setTitle(activeChar.getName()); npc.setTitle(activeChar.getName());
npc.setIsRunning(false); // broadcast info npc.setIsRunning(false); // broadcast info
if (sitem.getDespawnDelay() > 0) if (sitem.getDespawnDelay() > 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment