Skip to content

Commit

Permalink
Don't log the same console command history twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Dummiesman committed Jul 30, 2024
1 parent 6d57dc7 commit 6331e4e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/scripts/CoreMods/console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ local function historyReset()
end

local function executeCommand(cmd)
-- insert into command history, log command to console, and reset history position
table.insert(commandHistory, cmd)
-- insert into command history (if we didn't execute the last command over again)
-- log command to console, and reset history position
if #commandHistory == 0 or commandHistory[#commandHistory] ~= cmd then
table.insert(commandHistory, cmd)
end
insertCommandMessage(cmd)
trimCommandHistory()
historyReset()
Expand Down

0 comments on commit 6331e4e

Please sign in to comment.