From 9f92e2a1f76538d1d1e66686fc2551b5697264ec Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 30 Apr 2023 10:11:36 +0300 Subject: [PATCH] engine: client: console: do not save history if nothing was executed in console --- engine/client/console.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/client/console.c b/engine/client/console.c index 99dc67eb..41d2793f 100644 --- a/engine/client/console.c +++ b/engine/client/console.c @@ -1481,6 +1481,10 @@ static void Con_SaveHistory( con_history_t *self ) int historyStart = self->next - CON_HISTORY, i; file_t *f; + // do not save history if nothing was executed + if( self->next == 0 ) + return; + if( historyStart < 0 ) historyStart = 0;