diff --git a/addons/escoria-core/game/core-scripts/esc_room.gd b/addons/escoria-core/game/core-scripts/esc_room.gd index da73e9b4..de768005 100644 --- a/addons/escoria-core/game/core-scripts/esc_room.gd +++ b/addons/escoria-core/game/core-scripts/esc_room.gd @@ -4,13 +4,6 @@ extends Node2D class_name ESCRoom, "res://addons/escoria-core/design/esc_room.svg" -# Emitted when room has finished ":setup" event. -signal room_setup_done - -# Emitted when room has finished ":ready" event. -signal room_ready_done - - # Debugging displays for a room # NONE: No debug display # CAMERA_LIMITS: Display the camera limits @@ -82,6 +75,14 @@ func _ready(): add_child(game) move_child(game, 0) + # Determine whether this room was run from change_scene or directly + if escoria.main.has_node(name): + is_run_directly = false + else: + is_run_directly = true + if escoria.main.current_scene == null: + escoria.main.set_scene(self) + if player_scene: player = player_scene.instance() add_child(player) @@ -104,11 +105,7 @@ func _ready(): if global_id.empty(): global_id = name - # Determine whether this room was run from change_scene or directly - if escoria.main.has_node(name): - is_run_directly = false - else: - is_run_directly = true + # Manage player location at room start if player != null \ diff --git a/addons/escoria-core/game/main.gd b/addons/escoria-core/game/main.gd index d04ce7a2..bcc4f56b 100644 --- a/addons/escoria-core/game/main.gd +++ b/addons/escoria-core/game/main.gd @@ -40,7 +40,7 @@ func set_scene(p_scene: Node) -> void: if current_scene != null: clear_scene() - if p_scene.is_inside_tree() and not p_scene.get_parent() != self: + if p_scene.is_inside_tree() and p_scene.get_parent() != self: p_scene.get_parent().remove_child(p_scene) add_child(p_scene) diff --git a/game/rooms/room15/room15.tscn b/game/rooms/room15/room15.tscn index a9c19bbb..71348edb 100644 --- a/game/rooms/room15/room15.tscn +++ b/game/rooms/room15/room15.tscn @@ -20,7 +20,6 @@ __meta__ = { "_edit_vertical_guides_": [ ] } global_id = "room15" -esc_script = "res://game/rooms/room15/esc/wrong_file.esc" player_scene = ExtResource( 4 ) camera_limits = [ Rect2( 0, 0, 1289, 555 ) ]