1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-09-18 18:27:18 +02:00

Specialize the buffer creation functions.

This commit is contained in:
Sandu Liviu Catalin
2016-06-20 14:52:05 +03:00
parent c2ac1f3fd8
commit ad55025bc8
3 changed files with 64 additions and 1 deletions

View File

@@ -7,6 +7,9 @@
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
extern Object CreateBufferWrapperMove(Buffer && b);
// ------------------------------------------------------------------------------------------------
void Core::EmitCustomEvent(Int32 group, Int32 header, Object & payload)
{
@@ -1066,7 +1069,7 @@ void Core::EmitClientScriptData(Int32 player_id, const uint8_t * data, size_t si
// Replicate the data to the allocated buffer
b.Write(0, reinterpret_cast< Buffer::ConstPtr >(data), size);
// Wrap the buffer into a script object
const Object o = MakeObject(m_VM, BufferWrapper(std::move(b)));
const Object o = CreateBufferWrapperMove(std::move(b));
// Wrap the buffer into a script object
if (o.IsNull())
{