Skip to content

ProjectSettings.load_resource_pack overrides files in the main project if replace_files is false. #89299

Closed
@m4rr5

Description

@m4rr5

Tested versions

Reproducible in 4.2.1-stable.

System information

Godot v4.1.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 (NVIDIA; 31.0.15.2879) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

I'm trying to load a resource pack from a zip file using ProjectSettings.load_resource_pack() with the replace_files boolean set to false, but regardless the script file in the zip, which has the same name as an identical script in the main project, is being replaced.

Steps to reproduce

Open and run the sample project. It prints the following lines to the output window:

plugin loaded
hello from the plugin

That last line means it executed the hello() function from the res://Plugin.gd script in the plugin.zip. I would expect it to use the function from the same script that is already present in the main project.

Minimal reproduction project (MRP)

This is the project to reproduce the issue. It contains a plugin.zip which is exported from a second project which is listed here as the second file. You don't need it to reproduce the issue, but it's included in case you want to re-generate plugin.zip yourself.
godot-host.zip
godot-plugin.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions