2 small fixes from ArpyAge
This commit is contained in:
parent
8cd1b28cd3
commit
d34707ec94
@ -291,6 +291,10 @@ public class RoomManager {
|
|||||||
public Room loadRoom(int id, boolean loadData) {
|
public Room loadRoom(int id, boolean loadData) {
|
||||||
Room room = null;
|
Room room = null;
|
||||||
|
|
||||||
|
if(id == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.activeRooms.containsKey(id)) {
|
if (this.activeRooms.containsKey(id)) {
|
||||||
room = this.activeRooms.get(id);
|
room = this.activeRooms.get(id);
|
||||||
|
|
||||||
@ -411,7 +415,7 @@ public class RoomManager {
|
|||||||
|
|
||||||
public RoomLayout loadLayout(String name, Room room) {
|
public RoomLayout loadLayout(String name, Room room) {
|
||||||
RoomLayout layout = null;
|
RoomLayout layout = null;
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM room_models WHERE name LIKE ? LIMIT 1")) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM room_models WHERE name = ? LIMIT 1")) {
|
||||||
statement.setString(1, name);
|
statement.setString(1, name);
|
||||||
try (ResultSet set = statement.executeQuery()) {
|
try (ResultSet set = statement.executeQuery()) {
|
||||||
if (set.next()) {
|
if (set.next()) {
|
||||||
|
@ -232,7 +232,7 @@ public class WiredHandler {
|
|||||||
executed = true;
|
executed = true;
|
||||||
if (!effect.requiresTriggeringUser() || (roomUnit != null && effect.requiresTriggeringUser())) {
|
if (!effect.requiresTriggeringUser() || (roomUnit != null && effect.requiresTriggeringUser())) {
|
||||||
Emulator.getThreading().run(() -> {
|
Emulator.getThreading().run(() -> {
|
||||||
if (room.isLoaded()) {
|
if (room.isLoaded() && room.getHabbos().size() > 0) {
|
||||||
try {
|
try {
|
||||||
if (!effect.execute(roomUnit, room, stuff)) return;
|
if (!effect.execute(roomUnit, room, stuff)) return;
|
||||||
effect.setCooldown(millis);
|
effect.setCooldown(millis);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user