diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp index ac5ef3a5f..6d9349839 100644 --- a/src/engine/shared/console.cpp +++ b/src/engine/shared/console.cpp @@ -777,12 +777,6 @@ void CConsole::ParseArguments(int NumArgs, const char **ppArguments) // skip silent param continue; } - else if(ppArguments[i][0] == '-' && ppArguments[i][1] == 'd' && ppArguments[i][2] == 0) - { - // skip datadir param - ++i; - continue; - } else { // search arguments for overrides diff --git a/src/engine/shared/storage.cpp b/src/engine/shared/storage.cpp index 19d82dfd6..fd1047e57 100644 --- a/src/engine/shared/storage.cpp +++ b/src/engine/shared/storage.cpp @@ -35,15 +35,6 @@ public: // get userdir fs_storage_path(pApplicationName, m_aUserdir, sizeof(m_aUserdir)); - // check for datadir override - for(int i = 1; i < NumArgs; i++) - { - if(ppArguments[i][0] == '-' && ppArguments[i][1] == 'd' && ppArguments[i][2] == 0 && NumArgs - i > 1) - { - str_copy(m_aDatadir, ppArguments[i+1], sizeof(m_aDatadir)); - break; - } - } // get datadir FindDatadir(ppArguments[0]); @@ -157,35 +148,21 @@ public: void FindDatadir(const char *pArgv0) { - // 1) use provided data-dir override - if(m_aDatadir[0]) - { - char aBuffer[MAX_PATH_LENGTH]; - str_format(aBuffer, sizeof(aBuffer), "%s/mapres", m_aDatadir); - if(!fs_is_dir(aBuffer)) - { - dbg_msg("storage", "specified data directory '%s' does not exist", m_aDatadir); - m_aDatadir[0] = 0; - } - else - return; - } - - // 2) use data-dir in PWD if present + // 1) use data-dir in PWD if present if(fs_is_dir("data/mapres")) { str_copy(m_aDatadir, "data", sizeof(m_aDatadir)); return; } - // 3) use compiled-in data-dir if present + // 2) use compiled-in data-dir if present if(fs_is_dir(DATA_DIR "/mapres")) { str_copy(m_aDatadir, DATA_DIR, sizeof(m_aDatadir)); return; } - // 4) check for usable path in argv[0] + // 3) check for usable path in argv[0] { unsigned int Pos = ~0U; for(unsigned i = 0; pArgv0[i]; i++) @@ -207,7 +184,7 @@ public: } #if defined(CONF_FAMILY_UNIX) - // 5) check for all default locations + // 4) check for all default locations { const char *aDirs[] = { "/usr/share/teeworlds/data/mapres", diff --git a/src/game/client/components/particles.cpp b/src/game/client/components/particles.cpp index c12231ca5..479ac7ba1 100644 --- a/src/game/client/components/particles.cpp +++ b/src/game/client/components/particles.cpp @@ -35,6 +35,13 @@ void CParticles::OnReset() void CParticles::Add(int Group, CParticle *pPart) { + if(Client()->State() == IClient::STATE_DEMOPLAYBACK) + { + const IDemoPlayer::CInfo *pInfo = DemoPlayer()->BaseInfo(); + if(pInfo->m_Paused) + return; + } + if (m_FirstFree == -1) return; diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index bb79f5508..90a6b5943 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -417,8 +418,16 @@ void CPlayers::RenderPlayer( if ((Client()->GameTick()-Player.m_AttackTick) <= (SERVER_TICK_SPEED / 6) && g_pData->m_Weapons.m_aId[iw].m_NumSpriteMuzzles) { int IteX = rand() % g_pData->m_Weapons.m_aId[iw].m_NumSpriteMuzzles; - float Alpha = 1.0f; - if (Alpha > 0.0f && g_pData->m_Weapons.m_aId[iw].m_aSpriteMuzzles[IteX]) + if(Client()->State() == IClient::STATE_DEMOPLAYBACK) + { + static int s_LastIteX = IteX; + const IDemoPlayer::CInfo *pInfo = DemoPlayer()->BaseInfo(); + if(pInfo->m_Paused) + IteX = s_LastIteX; + else + s_LastIteX = IteX; + } + if(g_pData->m_Weapons.m_aId[iw].m_aSpriteMuzzles[IteX]) { vec2 Dir = vec2(pPlayerChar->m_X,pPlayerChar->m_Y) - vec2(pPrevChar->m_X, pPrevChar->m_Y); Dir = normalize(Dir); diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index e92e7b12b..14eb1e385 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -680,7 +680,7 @@ void IGameController::Tick() if(GameServer()->m_apPlayers[j] && GameServer()->m_apPlayers[j]->GetTeam() == -1) ++Spectators; if(Spectators >= g_Config.m_SvSpectatorSlots) - Server()->Kick(i, "kicked for inactivity"); + Server()->Kick(i, "Kicked for inactivity"); else GameServer()->m_apPlayers[i]->SetTeam(-1); }