[VMF Mod Manager] Forbid creating mods in runtime
This commit is contained in:
parent
4154e86310
commit
34e9bed306
1 changed files with 7 additions and 0 deletions
|
@ -16,6 +16,8 @@ local ERRORS = {
|
|||
"string, not %s.",
|
||||
mod_data_path_wrong_type = "[VMF Mod Manager] (new_mod) '%s': 'mod_data' (optional) should be a string, not %s.",
|
||||
mod_script_path_wrong_type = "[VMF Mod Manager] (new_mod) '%s': 'mod_script' should be a string, not %s.",
|
||||
too_late_for_mod_creation = "[VMF Mod Manager] (new_mod) '%s': you can't create mods after vanilla mod manager " ..
|
||||
"finishes loading mod bundles.",
|
||||
-- vmf.initialize_mod_data:
|
||||
mod_data_wrong_type = "[VMF Mod Manager] (new_mod) 'mod_data' initialization: mod_data file should return " ..
|
||||
"table, not %s.",
|
||||
|
@ -73,6 +75,11 @@ function new_mod(mod_name, mod_resources)
|
|||
return
|
||||
end
|
||||
|
||||
if vmf.all_mods_were_loaded then
|
||||
vmf:error(ERRORS.REGULAR.too_late_for_mod_creation, mod_name, type(mod_resources.mod_localization))
|
||||
return
|
||||
end
|
||||
|
||||
-- Create a mod object
|
||||
local mod = create_mod(mod_name)
|
||||
if not mod then
|
||||
|
|
Loading…
Add table
Reference in a new issue