MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / SetObject

Method SetObject

src/server/angelscript/angelscript/source/as_context.cpp:724–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

722}
723
724int asCContext::SetObject(void *obj)
725{
726 if( m_status != asEXECUTION_PREPARED )
727 return asCONTEXT_NOT_PREPARED;
728
729 if( !m_initialFunction->objectType )
730 {
731 m_status = asEXECUTION_ERROR;
732 return asERROR;
733 }
734
735 asASSERT( *(asPWORD*)&m_regs.stackFramePointer[0] == 0 );
736
737 *(asPWORD*)&m_regs.stackFramePointer[0] = (asPWORD)obj;
738
739 // TODO: This should be optional by having a flag where the application can chose whether it should be done or not
740 // The flag could be named something like takeOwnership and have default value of true
741 if( obj && (m_initialFunction->objectType->flags & asOBJ_SCRIPT_OBJECT) )
742 reinterpret_cast<asCScriptObject*>(obj)->AddRef();
743
744 return 0;
745}
746
747int asCContext::SetArgByte(asUINT arg, asBYTE value)
748{

Callers 10

CallOnThinkMethod · 0.80
CallOnMessageMethod · 0.80
CallDestructorMethod · 0.80
CopyFromAsMethod · 0.80
RefCastObjectMethod · 0.80
CompareRelationFunction · 0.80
CompareEqualityFunction · 0.80
EqualsMethod · 0.80
operator()Function · 0.80

Calls 1

AddRefMethod · 0.45

Tested by

no test coverage detected