mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-07 11:03:55 +00:00
Updated 'CreateVariable' so you can pass in a buffer
This commit is contained in:
@@ -493,6 +493,14 @@ duk_ret_t ILibDuktape_GenericMarshal_CreateVariable(duk_context *ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (duk_is_buffer_data(ctx, 0))
|
||||
{
|
||||
ptr = Duktape_GetBuffer(ctx, 0, &strLen);
|
||||
ILibDuktape_GenericMarshal_Variable_PUSH(ctx, ptr, (int)strLen);
|
||||
ILibDuktape_GenericMarshal_Variable_DisableAutoFree(ctx, -1);
|
||||
duk_dup(ctx, 0); duk_put_prop_string(ctx, -2, "\xFF_DuplicateBuffer");
|
||||
return(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return(ILibDuktape_Error(ctx, "_GenericMarshal.CreateVariable(): Invalid Parameter"));
|
||||
|
||||
Reference in New Issue
Block a user