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

@@ -145,7 +145,7 @@ public final class SiegeGuardManager
{
int hiredCount = 0;
final int hiredMax = MercTicketManager.getInstance().getMaxAllowedMerc(_castle.getResidenceId());
final boolean isHired = (getCastle().getOwnerId() > 0) ? true : false;
final boolean isHired = getCastle().getOwnerId() > 0;
loadSiegeGuard();
for (L2Spawn spawn : _siegeGuardSpawn)
{
@@ -195,14 +195,7 @@ public final class SiegeGuardManager
PreparedStatement ps = con.prepareStatement("SELECT * FROM castle_siege_guards Where castleId = ? And isHired = ?"))
{
ps.setInt(1, getCastle().getResidenceId());
if (getCastle().getOwnerId() > 0)
{
ps.setInt(2, 1);
}
else
{
ps.setInt(2, 0);
}
ps.setInt(2, getCastle().getOwnerId() > 0 ? 1 : 0);
try (ResultSet rs = ps.executeQuery())
{
while (rs.next())