fixed windows builds
This commit is contained in:
@@ -93,19 +93,14 @@ void IEngine::Init()
|
||||
signal(SIGTERM, IEngine_Signal);
|
||||
#endif
|
||||
|
||||
#ifdef STEAM_ENABLED
|
||||
if(SteamAPI_RestartAppIfNecessary(480))
|
||||
{
|
||||
Plat_Exit(0);
|
||||
}
|
||||
#ifdef STEAM_ENABLED
|
||||
if (!SteamAPI_Init())
|
||||
{
|
||||
Plat_FatalErrorFunc("failed to init steam\n");
|
||||
Plat_FatalErrorFunc("Failed to init Steam\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
IFileSystem::InitFilesystem();
|
||||
FileSystem()->InitFilesystem();
|
||||
px = px_init();
|
||||
|
||||
if (!ICommandLine::CheckParam("-dedicated"))
|
||||
@@ -123,7 +118,6 @@ void IEngine::Init()
|
||||
|
||||
INetworking::Init();
|
||||
|
||||
|
||||
// load game
|
||||
IServer::LoadGame("funnygame");
|
||||
|
||||
@@ -132,12 +126,13 @@ void IEngine::Init()
|
||||
IVideo::CreatePipelines();
|
||||
|
||||
// execute default config
|
||||
IConsole::AddCommand("exec default.cfg;");
|
||||
IConsole::Execute();
|
||||
Console()->AddCommand("exec default.cfg;");
|
||||
Console()->Execute();
|
||||
|
||||
MainMenu()->Init();
|
||||
|
||||
IConsoleUI::Init();
|
||||
|
||||
|
||||
};
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -145,11 +140,7 @@ void IEngine::Init()
|
||||
//-----------------------------------------------------------------------------
|
||||
void IEngine::Frame(float fDelta)
|
||||
{
|
||||
#ifdef STEAM_ENABLED
|
||||
SteamAPI_RunCallbacks();
|
||||
#endif
|
||||
IServer::Think(fDelta);
|
||||
INetworking::Frame();
|
||||
if (!ICommandLine::CheckParam("-dedicated"))
|
||||
{
|
||||
MainMenu()->Frame();
|
||||
@@ -175,13 +166,13 @@ uint64_t g_lastServerID = 1;
|
||||
uint64_t g_lastPredictedID = 1;
|
||||
CBaseEntity *IIEngine::SpawnEntity( const char *szName )
|
||||
{
|
||||
for (auto &entity: g_RegisteredEntities)
|
||||
for (auto &entity: EntityManager()->m_RegisteredEntities)
|
||||
{
|
||||
if (!V_strcmp(entity->m_szName, szName))
|
||||
{
|
||||
CBaseEntity *pEnt = entity->m_pfn();
|
||||
pEnt->m_id = g_lastPredictedID+=1;
|
||||
g_entities.AppendTail(pEnt);
|
||||
EntityManager()->m_entities.AppendTail(pEnt);
|
||||
if (ICommandLine::CheckParam("-dedicated"))
|
||||
return pEnt;
|
||||
if (entity->m_pClientfn)
|
||||
@@ -215,14 +206,14 @@ void IIEngine::DestroyEntity( CBaseEntity *pEntity )
|
||||
uint32_t i = 0;
|
||||
if (pEntity == NULL)
|
||||
return;
|
||||
for (auto &entity: g_entities)
|
||||
for (auto &entity: EntityManager()->m_entities)
|
||||
{
|
||||
if (pEntity == entity)
|
||||
{
|
||||
pEntity->Destroy();
|
||||
if (pEntity->pClientEntity)
|
||||
pEntity->pClientEntity->Destroy();
|
||||
g_entities.RemoveAt(i);
|
||||
EntityManager()->m_entities.RemoveAt(i);
|
||||
return;
|
||||
}
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user