Minor code changes.

This commit is contained in:
MobiusDev
2016-04-26 09:16:45 +00:00
parent f568bc6255
commit 6a13705766
13 changed files with 25 additions and 40 deletions

View File

@ -638,16 +638,9 @@ public class AutoSpawnHandler
return _locList.toArray(new Location[_locList.size()]);
}
public L2Npc[] getNPCInstanceList()
public List<L2Npc> getNPCInstanceList()
{
L2Npc[] ret;
synchronized (_npcList)
{
ret = new L2Npc[_npcList.size()];
_npcList.toArray(ret);
}
return ret;
return _npcList;
}
public List<L2Spawn> getSpawns()

View File

@ -386,10 +386,7 @@ public class L2Party extends AbstractPlayerGroup
{
synchronized (this)
{
if (_tacticalSigns == null)
{
_tacticalSigns = new ConcurrentHashMap<>(1);
}
_tacticalSigns = new ConcurrentHashMap<>(1);
}
}
return _tacticalSigns;

View File

@ -8320,7 +8320,7 @@ public final class L2PcInstance extends L2Playable
// Add Henna skills
for (SkillHolder skill : henna.getSkills())
{
if (!getAllSkills().contains(skill))
if (!getAllSkills().contains(skill.getSkill()))
{
addSkill(skill.getSkill(), true);
}

View File

@ -128,7 +128,7 @@ public class Friend
public String getName()
{
if (_name == "")
if (_name.equals(""))
{
_name = CharNameTable.getInstance().getNameById(_friendOID);
}

View File

@ -150,19 +150,17 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
PreparedStatement ps = con.prepareStatement(SQL_LOAD_GUARDS))
{
ps.setInt(1, _hall.getId());
try (ResultSet rset = ps.executeQuery())
final ResultSet rset = ps.executeQuery();
while (rset.next())
{
while (rset.next())
{
final L2Spawn spawn = new L2Spawn(rset.getInt("npcId"));
spawn.setX(rset.getInt("x"));
spawn.setY(rset.getInt("y"));
spawn.setZ(rset.getInt("z"));
spawn.setHeading(rset.getInt("heading"));
spawn.setRespawnDelay(rset.getInt("respawnDelay"));
spawn.setAmount(1);
_guards.add(spawn);
}
final L2Spawn spawn = new L2Spawn(rset.getInt("npcId"));
spawn.setX(rset.getInt("x"));
spawn.setY(rset.getInt("y"));
spawn.setZ(rset.getInt("z"));
spawn.setHeading(rset.getInt("heading"));
spawn.setRespawnDelay(rset.getInt("respawnDelay"));
spawn.setAmount(1);
_guards.add(spawn);
}
}
catch (Exception e)