When forcefully removing a prisoner, check for a cell. This closes #17
This commit is contained in:
parent
c249a44f35
commit
2027331540
@ -886,6 +886,8 @@ public class JailIO {
|
|||||||
PreparedStatement pp = con.prepareStatement("delete from `" + prefix + "prisoners` where name = ? limit 1;");
|
PreparedStatement pp = con.prepareStatement("delete from `" + prefix + "prisoners` where name = ? limit 1;");
|
||||||
pp.setString(1, p.getName());
|
pp.setString(1, p.getName());
|
||||||
|
|
||||||
|
pl.debug("Removing " + p.getName() + " from MySQL database.");
|
||||||
|
|
||||||
pp.executeUpdate();
|
pp.executeUpdate();
|
||||||
pp.close();
|
pp.close();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
@ -417,7 +417,12 @@ public class PrisonerManager {
|
|||||||
if(player == null) {
|
if(player == null) {
|
||||||
//Player is offline, we just forcefully remove them from the database
|
//Player is offline, we just forcefully remove them from the database
|
||||||
pl.getJailIO().removePrisoner(jail, cell, prisoner);
|
pl.getJailIO().removePrisoner(jail, cell, prisoner);
|
||||||
|
|
||||||
|
if(cell == null) {
|
||||||
jail.removePrisoner(prisoner);
|
jail.removePrisoner(prisoner);
|
||||||
|
}else {
|
||||||
|
cell.removePrisoner();
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
try {
|
try {
|
||||||
unJail(jail, cell, player, prisoner);
|
unJail(jail, cell, player, prisoner);
|
||||||
|
Loading…
Reference in New Issue
Block a user