Skip to content

Commit 071fae8

Browse files
validate that mod ID is {namespace}-{name}
1 parent ad07925 commit 071fae8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

loader/mod_loader.gd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,13 @@ func _load_meta_data(mod_id):
393393
# Add the meta data to the mod
394394
mod.meta_data = meta_data
395395

396+
# Check that the mod ID is correct. This will fail if the mod's folder in
397+
# "res://mods-unpacked" does not match its full ID, which is `namespace.name`
398+
var mod_check_id = _get_mod_full_id(mod)
399+
if mod_id != mod_check_id:
400+
mod_log(str("ERROR - ", mod_id, " - Mod ID does not match the data in manifest.json. Expected '", mod_id ,"', but '{namespace}-{name}' was '", mod_check_id ,"'"), LOG_NAME)
401+
mod.is_loadable = false
402+
396403

397404
# Ensure manifest.json has all required keys
398405
func _check_meta_file(meta_data):

0 commit comments

Comments
 (0)