This commit is contained in:
duckietm 2024-04-05 15:07:21 +02:00
commit 2b5c57b1bc
3 changed files with 6 additions and 2 deletions

View File

@ -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()) {

View File

@ -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);