Ir para conteúdo

[TFS 1.x] save automatico ao sair


kaleudd

Posts Recomendados

em game.cpp,procure por:

oid Game::shutdown()
{
   std::cout << "Shutting down..." << std::flush;

   g_scheduler.shutdown();
   g_databaseTasks.shutdown();
   g_dispatcher.shutdown();
   map.spawns.clear();
   raids.clear();

   cleanup();

   if (serviceManager) {
     serviceManager->stop();
   }

   ConnectionManager::getInstance().closeAll();

   std::cout << " done!" << std::endl;
}

e substitua por este:

void Game::shutdown()
{
   std::cout << ">> Shutting down...\n> " << std::flush;

   saveGameState();
   g_scheduler.shutdown();
   g_databaseTasks.shutdown();
   g_dispatcher.shutdown();
   map.spawns.clear();
   raids.clear();

   cleanup();

   if (serviceManager) {
     serviceManager->stop();
   }

   ConnectionManager::getInstance().closeAll();

   std::cout << "> Done!" << std::endl;
}

créditos:

Fir3element
Link para o comentário
Compartilhar em outros sites

  • 1 month later...
×
×
  • Criar Novo...