Code improvements.

This commit is contained in:
MobiusDev
2016-04-24 16:30:15 +00:00
parent 8bd51aba1c
commit 2dd14bef9b
860 changed files with 8865 additions and 17041 deletions

View File

@@ -119,16 +119,18 @@ public class InstanceWorld
*/
public void onDeath(L2Character killer, L2Character victim)
{
if ((victim != null) && victim.isPlayer())
if ((victim == null) || !victim.isPlayer())
{
final Instance instance = InstanceManager.getInstance().getInstance(getInstanceId());
if (instance != null)
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTE_S_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE);
sm.addInt(instance.getEjectTime() / 60 / 1000);
victim.getActingPlayer().sendPacket(sm);
instance.addEjectDeadTask(victim.getActingPlayer());
}
return;
}
final Instance instance = InstanceManager.getInstance().getInstance(getInstanceId());
if (instance == null)
{
return;
}
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTE_S_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE);
sm.addInt(instance.getEjectTime() / 60 / 1000);
victim.getActingPlayer().sendPacket(sm);
instance.addEjectDeadTask(victim.getActingPlayer());
}
}