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

@@ -239,11 +239,7 @@ public final class MercTicketManager
count++;
}
}
if (count >= limit)
{
return true;
}
return false;
return count >= limit;
}
/**
@@ -272,11 +268,7 @@ public final class MercTicketManager
count++;
}
}
if (count >= limit)
{
return true;
}
return false;
return count >= limit;
}
public int getMaxAllowedMerc(int castleId)
@@ -347,17 +339,17 @@ public final class MercTicketManager
private void spawnMercenary(int npcId, int x, int y, int z, int despawnDelay)
{
final L2NpcTemplate template = NpcData.getInstance().getTemplate(npcId);
if (template != null)
if (template == null)
{
final L2DefenderInstance npc = new L2DefenderInstance(template);
npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
npc.setDecayed(false);
npc.spawnMe(x, y, (z + 20));
if (despawnDelay > 0)
{
npc.scheduleDespawn(despawnDelay);
}
return;
}
final L2DefenderInstance npc = new L2DefenderInstance(template);
npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
npc.setDecayed(false);
npc.spawnMe(x, y, (z + 20));
if (despawnDelay > 0)
{
npc.scheduleDespawn(despawnDelay);
}
}