From 17ea975970d8f2be994bb1c8e7646f9c8a6c4647 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:44:21 +1100 Subject: [PATCH] Update StarCommandProcessor.cpp --- source/game/StarCommandProcessor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/game/StarCommandProcessor.cpp b/source/game/StarCommandProcessor.cpp index ee0b4fb..46222ce 100644 --- a/source/game/StarCommandProcessor.cpp +++ b/source/game/StarCommandProcessor.cpp @@ -222,7 +222,7 @@ String CommandProcessor::timescale(ConnectionId connectionId, String const& argu auto arguments = m_parser.tokenizeToStringList(argumentsString); if (arguments.empty()) - return "Not enough arguments to /timescale"; + return strf("Current timescale is {:6.6f}x", GlobalTimescale); float timescale = clamp(lexicalCast(arguments[0]), 0.001f, 32.0f); m_universe->setTimescale(timescale); @@ -236,11 +236,11 @@ String CommandProcessor::tickrate(ConnectionId connectionId, String const& argum auto arguments = m_parser.tokenizeToStringList(argumentsString); if (arguments.empty()) - return "Not enough arguments to /tickrate"; + return strf("Current tick rate is {:4.2f}Hz", 1.0f / ServerGlobalTimestep); - unsigned tickRate = clamp(lexicalCast(arguments[0]), 5, 500); + float tickRate = clamp(lexicalCast(arguments[0]), 5.f, 500.f); m_universe->setTickRate(tickRate); - return strf("Set tick rate to {}Hz", tickRate); + return strf("Set tick rate to {:4.2f}Hz", tickRate); } String CommandProcessor::setTileProtection(ConnectionId connectionId, String const& argumentString) {