@tool
extends EditorPlugin

func _enter_tree() -> void:
	# This doesn't function in Godot4
	# get_editor_interface().get_editor_data().connect("scene_saved", self, "_on_scene_saved")
	pass

func _exit_tree() -> void:
	# get_editor_interface().get_editor_data().disconnect("scene_saved", self, "_on_scene_saved")
	pass

func _on_scene_saved(scene: PackedScene) -> void:
	var instance: Node = scene.instantiate()
	instance.queue_free.call_deferred()

	for node in instance.get_children():
		if node is StandardRoom:
			node._validate()
