Skip to content

Instantly share code, notes, and snippets.

@psi29a
Created April 11, 2018 07:55
Show Gist options
  • Save psi29a/14762528550a4a767a738f088c73aa22 to your computer and use it in GitHub Desktop.
Save psi29a/14762528550a4a767a738f088c73aa22 to your computer and use it in GitHub Desktop.
diff --git a/scriptsystem/ScriptSystem.cpp b/scriptsystem/ScriptSystem.cpp
index 415e482..89c52ac 100644
--- a/scriptsystem/ScriptSystem.cpp
+++ b/scriptsystem/ScriptSystem.cpp
@@ -42,13 +42,6 @@ void _MessageCallback(const asSMessageInfo *msg, void *param)
type = "INFO";
char szDebugOut[256];
- sprintf(szDebugOut, "%s (%d, %d) : %s : %s\n", msg->section, msg->row, msg->col, type, msg->message);
-#if PLATFORM_WIN
- OutputDebugString(szDebugOut);
-#else
- printf("%s", szDebugOut);
-#endif
-
sprintf(szDebugOut, "^1ScriptError: %s (%d, %d) : %s : %s\n", msg->section, msg->row, msg->col, type, msg->message);
XL_Console::Print(szDebugOut);
}
@@ -257,29 +250,40 @@ uint32_t ScriptSystem::ExecuteFunc(SHANDLE hFunc, int32_t nArgCnt, const ScriptA
uint32_t uRetValue = 0;
if ( hFunc )
{
- m_pContext->Prepare(hFunc);
+ int r_prep = m_pContext->Prepare(hFunc);
+ std::string GetModuleName = hFunc->GetModuleName();
+ int GetParamCount = hFunc->GetParamCount();
+ std::string GetName = hFunc->GetName();
if ( nArgCnt > 0 && pArgs )
{
for (int32_t i=0; i<nArgCnt; i++)
{
+ XL_Console::PrintF("Argument %i/%i, %i", i, nArgCnt-1, pArgs[i].uType );
+ int r_set = 0;
switch (pArgs[i].uType)
{
case SC_ARG_uint8_t:
- m_pContext->SetArgByte(i, pArgs[i].arguint8_t);
+ r_set =m_pContext->SetArgByte(i, pArgs[i].arguint8_t);
break;
case SC_ARG_uint16_t:
- m_pContext->SetArgWord(i, pArgs[i].arguint16_t);
+ r_set = m_pContext->SetArgWord(i, pArgs[i].arguint16_t);
break;
case SC_ARG_uint32_t:
- m_pContext->SetArgDWord(i, pArgs[i].arguint32_t);
+ r_set = m_pContext->SetArgDWord(i, pArgs[i].arguint32_t);
+ XL_Console::PrintF("Argument value %i", i, pArgs[i].arguint32_t );
break;
case SC_ARG_float:
- m_pContext->SetArgFloat(i, pArgs[i].argfloat);
+ r_set = m_pContext->SetArgFloat(i, pArgs[i].argfloat);
break;
+ default:
+ XL_Console::PrintF("Bad Argument Type %i", pArgs[i].uType);
};
+ XL_Console::PrintF("Return value of SetArgDWord: %i", r_set);
}
}
- m_pContext->Execute();
+
+ int r_exec = m_pContext->Execute();
+
if ( bRetValueExpected )
{
uRetValue = (uint32_t)m_pContext->GetReturnDWord();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment