Check for old VMF mods

This commit is contained in:
Azumgi 2018-10-11 12:49:54 +03:00
parent fcffb8a2d3
commit e70b8b5fa5
2 changed files with 10 additions and 0 deletions

View file

@ -19,6 +19,15 @@ function vmf.check_wrong_argument_type(mod, vmf_function_name, argument_name, ar
return true
end
function vmf.check_old_vmf()
local old_vmf_table = rawget(_G, "Mods")
if old_vmf_table and old_vmf_table.exec then
error("Unfortunately, workshop mods and old-fashioned mods (VMF-pack or QoL) are incompatible. " ..
"Either remove old mods or disable workshop mods.")
end
end
function vmf.throw_error(error_message, ...)
error(string.format(error_message, ...), 0)
end

View file

@ -99,6 +99,7 @@ end
function vmf_mod_object:on_game_state_changed(status, state)
print("VMF:ON_GAME_STATE_CHANGED(), status: " .. tostring(status) .. ", state: " .. tostring(state))
if VT1 then vmf.check_old_vmf() end
vmf.mods_game_state_changed_event(status, state)
vmf.save_unsaved_settings_to_file()
vmf.apply_delayed_hooks(status, state)