Merge branch 'development' of https://github.com/TorqueGameEngines/Torque3D into aiSubsystem

This commit is contained in:
AzaezelX 2025-04-26 10:11:13 -05:00
commit 20976b485c
28 changed files with 176 additions and 84 deletions

View file

@ -425,39 +425,42 @@ void SimDataBlock::write(Stream &stream, U32 tabStop, U32 flags)
// MARK: ---- API ----
//-----------------------------------------------------------------------------
DefineEngineMethod( SimDataBlock, reloadOnLocalClient, void, (),,
"Reload the datablock. This can only be used with a local client configuration." )
void SimDataBlock::reloadOnLocalClient()
{
// Make sure we're running a local client.
GameConnection* localClient = GameConnection::getLocalClientConnection();
if( !localClient )
if (!localClient)
return;
// Do an in-place pack/unpack/preload.
if( !object->preload( true, NetConnection::getErrorBuffer() ) )
if (!preload(true, NetConnection::getErrorBuffer()))
{
Con::errorf( NetConnection::getErrorBuffer() );
Con::errorf(NetConnection::getErrorBuffer());
return;
}
U8 buffer[ 16384 ];
BitStream stream( buffer, 16384 );
U8 buffer[16384];
BitStream stream(buffer, 16384);
object->packData( &stream );
packData(&stream);
stream.setPosition(0);
object->unpackData( &stream );
unpackData(&stream);
if( !object->preload( false, NetConnection::getErrorBuffer() ) )
if (!preload(false, NetConnection::getErrorBuffer()))
{
Con::errorf( NetConnection::getErrorBuffer() );
Con::errorf(NetConnection::getErrorBuffer());
return;
}
// Trigger a post-apply so that change notifications respond.
object->inspectPostApply();
inspectPostApply();
}
DefineEngineMethod( SimDataBlock, reloadOnLocalClient, void, (),,
"Reload the datablock. This can only be used with a local client configuration." )
{
object->reloadOnLocalClient();
}
//-----------------------------------------------------------------------------

View file

@ -176,6 +176,8 @@ public:
/// Used by the console system to automatically tell datablock classes apart
/// from non-datablock classes.
static const bool __smIsDatablock = true;
void reloadOnLocalClient();
protected:
struct SubstitutionStatement
{