Repository: godotengine/godot
File: core/config/project_settings.cpp (C++)

Code before:
		String data_dir = OS::get_singleton()->get_user_data_dir();
		if (!data_dir.is_empty()) {
			return p_path.replace("user:/", data_dir);
		}
		return p_path.replace("user://", "");
	}

	return p_path;
}

bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
	_THREAD_SAFE_METHOD_

	// Early return if value hasn't changed (unless it's being deleted)
	if (p_value.get_type() != Variant::NIL) {
		if (props.has(p_name) && props[p_name].variant == p_value) {
			return true;
		}
	}

#ifndef DISABLE_DEPRECATED
	if (p_name == SNAME("application/config/features")) {
		const PackedStringArray features = p_value;
		for (const String &feat : features) {
			if (feat.contains_char('.')) {
				if (feat.get_slicec('.', 1).to_int() < 6) {
					// Enable MeshInstance3D compat for projects created before 4.6.
					set_setting("animation/compatibility/default_parent_skeleton_in_mesh_instance_3d", true);
				}
				break;
			}
		}
	}
#endif

	if (p_value.get_type() == Variant::NIL) {
		props.erase(p_name);
		if (p_name.operator String().begins_with("autoload/")) {
			String node_name = p_name.operator String().get_slicec('/', 1);
			if (autoloads.has(node_name)) {
				remove_autoload(node_name);
			}
		} else if (p_name.operator String().begins_with("global_group/")) {
			String group_name = p_name.operator String().get_slicec('/', 1);
			if (global_groups.has(group_name)) {
				remove_global_group(group_name);
			}
		}
	} else {
		if (p_name == CoreStringName(_custom_features)) {
			Vector<String> custom_feature_array = String(p_value).split(",");

Review comment (suggestion):
This is such a hack this is such a hack this is such a hack aaaaaaaa...
but at least let's make this as clear as possible
```suggestion
		for (const String &feature : features) {
			if (feature.contains_char('.')) {
				int major_version = feature.get_slicec('.', 0).to_int();
				int minor_version = feature.get_slicec('.', 1).to_int();
				if (major_version >= 4 && minor_version < 6) {
```

Code after:
		String data_dir = OS::get_singleton()->get_user_data_dir();
		if (!data_dir.is_empty()) {
			return p_path.replace("user:/", data_dir);
		}
		return p_path.replace("user://", "");
	}

	return p_path;
}

bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
	_THREAD_SAFE_METHOD_

	// Early return if value hasn't changed (unless it's being deleted)
	if (p_value.get_type() != Variant::NIL) {
		if (props.has(p_name) && props[p_name].variant == p_value) {
			return true;
		}
	}

	if (p_value.get_type() == Variant::NIL) {
		props.erase(p_name);
		if (p_name.operator String().begins_with("autoload/")) {
			String node_name = p_name.operator String().get_slicec('/', 1);
			if (autoloads.has(node_name)) {
				remove_autoload(node_name);
			}
		} else if (p_name.operator String().begins_with("global_group/")) {
			String group_name = p_name.operator String().get_slicec('/', 1);
			if (global_groups.has(group_name)) {
				remove_global_group(group_name);
			}
		}
	} else {
		if (p_name == CoreStringName(_custom_features)) {
			Vector<String> custom_feature_array = String(p_value).split(",");
			for (int i = 0; i < custom_feature_array.size(); i++) {
				custom_features.insert(custom_feature_array[i]);
			}

			_version++;
			_queue_changed(p_name);
			return true;
		}

		{ // Feature overrides.
			int dot = p_name.operator String().find_char('.');
			if (dot != -1) {
				Vector<String> s = p_name.operator String().split(".");

				for (int i = 1; i < s.size(); i++) {