mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 05:57:45 +00:00
improve script reloading and fix openinggridania
This commit is contained in:
parent
70960ceb1d
commit
89b6ac76df
2 changed files with 13 additions and 1 deletions
|
@ -63,6 +63,8 @@ public:
|
|||
Scene00030( player );
|
||||
}
|
||||
};
|
||||
|
||||
player.eventPlay( getId(), 40, 1, 2, 1, callback );
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
|
|
|
@ -154,14 +154,24 @@ namespace Core {
|
|||
|
||||
void NativeScriptManager::processLoadQueue()
|
||||
{
|
||||
std::vector< std::string > deferredLoads;
|
||||
|
||||
while( !m_scriptLoadQueue.empty() )
|
||||
{
|
||||
auto item = m_scriptLoadQueue.front();
|
||||
|
||||
loadScript( item );
|
||||
// if it fails, we defer the loading to the next tick
|
||||
if( !loadScript( item ) )
|
||||
deferredLoads.push_back( item );
|
||||
|
||||
m_scriptLoadQueue.pop();
|
||||
}
|
||||
|
||||
if( !deferredLoads.empty() )
|
||||
{
|
||||
for( auto& item : deferredLoads )
|
||||
m_scriptLoadQueue.push( item );
|
||||
}
|
||||
}
|
||||
|
||||
void NativeScriptManager::findScripts( std::set< Core::Scripting::ScriptInfo* >& scripts, const std::string& search )
|
||||
|
|
Loading…
Add table
Reference in a new issue