fixed non directory mod reloading for dev mode
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled

modName is the mod's actual name during a reload, when it needs to be the file path for non directory mods.
This commit is contained in:
Isaac0-dev 2025-08-08 12:19:31 +10:00
parent 7c54a80f84
commit a38a7525b5

View file

@ -348,10 +348,10 @@ static bool mod_load_files_dir(struct Mod* mod, char* fullPath, const char* subD
return true;
}
static bool mod_load_files(struct Mod* mod, char* modName, char* fullPath) {
static bool mod_load_files(struct Mod* mod, char* fullPath) {
// read single lua file
if (!mod->isDirectory) {
return (mod_allocate_file(mod, modName) != NULL);
return (mod_allocate_file(mod, mod->relativePath) != NULL);
}
// deal with mod directory
@ -526,7 +526,7 @@ bool mod_refresh_files(struct Mod* mod) {
dynos_generate_mod_pack(mod->basePath);
// read files
if (!mod_load_files(mod, mod->name, mod->basePath)) {
if (!mod_load_files(mod, mod->basePath)) {
LOG_ERROR("Failed to load mod files for '%s'", mod->name);
return false;
}
@ -613,7 +613,7 @@ bool mod_load(struct Mods* mods, char* basePath, char* modName) {
mod->isDirectory = isDirectory;
// read files
if (!mod_load_files(mod, modName, fullPath)) {
if (!mod_load_files(mod, fullPath)) {
LOG_ERROR("Failed to load mod files for '%s'", modName);
return false;
}