Check for old VMF mods
This commit is contained in:
parent
fcffb8a2d3
commit
e70b8b5fa5
2 changed files with 10 additions and 0 deletions
|
@ -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
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue