Skip to content

Commit

Permalink
Don't save/restore squirrel class attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
samisalreadytaken committed Jun 29, 2024
1 parent 77f6459 commit 26346ba
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions sp/src/vscript/vscript_squirrel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3514,21 +3514,18 @@ void SquirrelVM::WriteObject( const SQObjectPtr &obj, CUtlBuffer* pBuffer, Write
WriteObject( pThis->_base, pBuffer, writeState );
}
WriteObject( pThis->_members, pBuffer, writeState );
WriteObject( pThis->_attributes, pBuffer, writeState );

int count = pThis->_defaultvalues.size();
pBuffer->PutInt( count );
for ( int i = 0; i < count; ++i )
{
WriteObject( pThis->_defaultvalues[i].attrs, pBuffer, writeState );
WriteObject( pThis->_defaultvalues[i].val, pBuffer, writeState );
}

count = pThis->_methods.size();
pBuffer->PutInt( count );
for ( int i = 0; i < count; ++i )
{
WriteObject( pThis->_methods[i].attrs, pBuffer, writeState );
WriteObject( pThis->_methods[i].val, pBuffer, writeState );
}

Expand Down Expand Up @@ -4069,7 +4066,7 @@ void SquirrelVM::ReadObject( SQObjectPtr &pObj, CUtlBuffer* pBuffer, ReadStateMa
}
else if ( type == ScriptClassType )
{
SQObjectPtr base, members, attributes;
SQObjectPtr base, members;

if ( pBuffer->GetChar() )
{
Expand All @@ -4082,7 +4079,6 @@ void SquirrelVM::ReadObject( SQObjectPtr &pObj, CUtlBuffer* pBuffer, ReadStateMa
readState.StoreInCache( marker, obj );

ReadObject( members, pBuffer, readState );
ReadObject( attributes, pBuffer, readState );

Assert( members._type == OT_TABLE );

Expand All @@ -4091,21 +4087,17 @@ void SquirrelVM::ReadObject( SQObjectPtr &pObj, CUtlBuffer* pBuffer, ReadStateMa
pThis->_members = members._unVal.pTable;
__ObjAddRef( pThis->_members );

pThis->_attributes = attributes;

int count = pBuffer->GetInt();
pThis->_defaultvalues.resize( count );
for ( int i = 0; i < count; ++i )
{
ReadObject( pThis->_defaultvalues[i].attrs, pBuffer, readState );
ReadObject( pThis->_defaultvalues[i].val, pBuffer, readState );
}

count = pBuffer->GetInt();
pThis->_methods.resize( count );
for ( int i = 0; i < count; ++i )
{
ReadObject( pThis->_methods[i].attrs, pBuffer, readState );
ReadObject( pThis->_methods[i].val, pBuffer, readState );
}

Expand Down

0 comments on commit 26346ba

Please sign in to comment.