From 5ca42599ef52236274938dba9bd6e113611cb734 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 19 Mar 2024 13:35:55 +1100 Subject: make timescale a server command and add a tickrate command --- source/game/StarUniverseClient.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/game/StarUniverseClient.cpp') diff --git a/source/game/StarUniverseClient.cpp b/source/game/StarUniverseClient.cpp index 57033f8..752d081 100644 --- a/source/game/StarUniverseClient.cpp +++ b/source/game/StarUniverseClient.cpp @@ -164,6 +164,7 @@ void UniverseClient::disconnect() { break; } + GlobalTimescale = 1.0f; reset(); m_mainPlayer = {}; } @@ -675,6 +676,7 @@ void UniverseClient::handlePackets(List const& packets) { m_celestialDatabase->invalidateCacheFor(planetTypeUpdate->coordinate); } else if (auto pausePacket = as(packet)) { setPause(pausePacket->pause); + GlobalTimescale = clamp(pausePacket->timescale, 0.0f, 1024.f); } else if (auto serverInfoPacket = as(packet)) { m_serverInfo = ServerInfo{serverInfoPacket->players, serverInfoPacket->maxPlayers}; } else if (!m_systemWorldClient->handleIncomingPacket(packet)) { -- cgit v1.2.3