Exemplo n.º 1
0
bool RunScriptLine(const char* buf)
{
	// create a Script object
	UInt8	scriptObjBuf[sizeof(Script)];
	Script	* tempScriptObj = (Script *)scriptObjBuf;

	void	* scriptState = GetGlobalScriptStateObj();

	tempScriptObj->Constructor();
	tempScriptObj->MarkAsTemporary();
	tempScriptObj->SetText(buf);
	bool bResult = tempScriptObj->CompileAndRun(*((void**)scriptState), 1, NULL);
	tempScriptObj->StaticDestructor();

	return bResult;
}
Exemplo n.º 2
0
bool RunScriptLineOnREFR(const char * buf, TESObjectREFR* callingObj, bool bSuppressOutput)
{
	ToggleConsoleOutput(!bSuppressOutput);

	// create a Script object
	UInt8	scriptObjBuf[sizeof(Script)];
	Script	* tempScriptObj = (Script *)scriptObjBuf;

	void	* scriptState = GetGlobalScriptStateObj();

	tempScriptObj->Constructor();
	tempScriptObj->MarkAsTemporary();
	tempScriptObj->SetText(buf);
	bool bResult = tempScriptObj->CompileAndRun(*((void**)scriptState), 1, callingObj);
	tempScriptObj->StaticDestructor();

	ToggleConsoleOutput(true);
	return bResult;
}