From c56bea9d5fcbf239a63992eb9a141b43cb780184 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 9 Sep 2022 02:01:47 +0100 Subject: Make internal penalty be specified in millisecs instead of seconds. This removes the need to multiply it later. --- src/command_parse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/command_parse.cpp') diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 8a04ea72f..7f1ddf177 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -181,10 +181,10 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman if (!user->HasPrivPermission("users/flood/no-throttle")) { // If it *doesn't* exist, give it a slightly heftier penalty than normal to deter flooding us crap - unsigned int penalty = (handler ? handler->Penalty * 1000 : 2000); + unsigned int penalty = handler ? handler->penalty : 2000; user->CommandFloodPenalty += penalty; - // Increase their penalty later if we fail and the command has 0 penalty by default (i.e. in Command::Penalty) to + // Increase their penalty later if we fail and the command has 0 penalty by default (i.e. in Command::penalty) to // throttle sending ERR_* from the command parser. If the command does have a non-zero penalty then this is not // needed because we've increased their penalty above. if (penalty == 0) -- cgit v1.3.1-10-gc9f91