From b1f2a693820537c6ecd47b84056da136e2f9f563 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 8 Nov 2019 20:18:41 +0100 Subject: Introduce get_modpath() for CSM --- clientmods/preview/example.lua | 2 +- clientmods/preview/init.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'clientmods/preview') diff --git a/clientmods/preview/example.lua b/clientmods/preview/example.lua index 2f661c073..41dc3b284 100644 --- a/clientmods/preview/example.lua +++ b/clientmods/preview/example.lua @@ -1,2 +1,2 @@ print("Loaded example file!, loading more examples") -dofile("preview:examples/first.lua") +dofile(core.get_modpath(core.get_current_modname()) .. "examples/first.lua") diff --git a/clientmods/preview/init.lua b/clientmods/preview/init.lua index bb8d1d600..95cf9ce64 100644 --- a/clientmods/preview/init.lua +++ b/clientmods/preview/init.lua @@ -1,9 +1,9 @@ -local modname = core.get_current_modname() or "??" +local modname = assert(core.get_current_modname()) local modstorage = core.get_mod_storage() local mod_channel -dofile("preview:example.lua") --- This is an example function to ensure it's working properly, should be removed before merge +dofile(core.get_modpath(modname) .. "example.lua") + core.register_on_shutdown(function() print("[PREVIEW] shutdown client") end) -- cgit v1.2.3