baso88 / SC_AngelScript

Sven Co-op AngelScript documentation, tutorials, sample code and tools
41 stars 4 forks source link

ItemInfo is missing opAssign #37

Closed fnky closed 7 years ago

fnky commented 7 years ago

ItemInfo is missing the opAssign method.

fnky commented 7 years ago

Code to fix this:

static ItemInfo& ItemInfo_opAssign( const ItemInfo* pThis, const ItemInfo& other )
{
    *pThis = other;
    return *pThis;
}

//In RegisterSCScriptItemInfo:
pDocumentation->RegisterObjectMethod( "Assignment operator",
    pszObjectName, "ItemInfo& opAssign(const ItemInfo& in other)",
    asFUNCTION( ItemInfo_opAssign ), asCALL_CDECL_OBJFIRST );

In trunk/dlls/Angelscript/ScriptTypes/Entity/ASPlayerItemEntity.cpp

Untested, but should work fine. If not, adjust as needed.

baso88 commented 7 years ago

The fix for this issue will be included in the next update (5.13). Closing.