1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 14:07:46 +00:00

improve script reloading and fix openinggridania

This commit is contained in:
GokuWeedLord 2017-12-15 00:19:30 +11:00
parent 70960ceb1d
commit 89b6ac76df
2 changed files with 13 additions and 1 deletions

View file

@ -63,6 +63,8 @@ public:
Scene00030( player );
}
};
player.eventPlay( getId(), 40, 1, 2, 1, callback );
}
///////////////////////////////

View file

@ -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 )