aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/scriptutility.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/scriptutility.cpp')
-rw-r--r--NorthstarDLL/scriptutility.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/NorthstarDLL/scriptutility.cpp b/NorthstarDLL/scriptutility.cpp
index 7a1936cf..1ff8e4bb 100644
--- a/NorthstarDLL/scriptutility.cpp
+++ b/NorthstarDLL/scriptutility.cpp
@@ -2,22 +2,13 @@
#include "squirrel.h"
// asset function StringToAsset( string assetName )
-template <ScriptContext context> SQRESULT SQ_StringToAsset(HSquirrelVM* sqvm)
+ADD_SQFUNC(
+ "asset",
+ StringToAsset,
+ "string assetName",
+ "converts a given string to an asset",
+ ScriptContext::UI | ScriptContext::CLIENT | ScriptContext::SERVER)
{
g_pSquirrel<context>->pushasset(sqvm, g_pSquirrel<context>->getstring(sqvm, 1), -1);
return SQRESULT_NOTNULL;
}
-
-ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ClientSharedScriptUtility, ClientSquirrel, (CModule module))
-{
- g_pSquirrel<ScriptContext::CLIENT>->AddFuncRegistration(
- "asset", "StringToAsset", "string assetName", "converts a given string to an asset", SQ_StringToAsset<ScriptContext::CLIENT>);
- g_pSquirrel<ScriptContext::UI>->AddFuncRegistration(
- "asset", "StringToAsset", "string assetName", "converts a given string to an asset", SQ_StringToAsset<ScriptContext::UI>);
-}
-
-ON_DLL_LOAD_RELIESON("server.dll", ServerSharedScriptUtility, ServerSquirrel, (CModule module))
-{
- g_pSquirrel<ScriptContext::SERVER>->AddFuncRegistration(
- "asset", "StringToAsset", "string assetName", "converts a given string to an asset", SQ_StringToAsset<ScriptContext::SERVER>);
-} \ No newline at end of file