From 2e54a7e7c773615f8ff7dc2ef2b4ba8656ee8f4f Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 14 Apr 2024 14:21:53 +0200 Subject: Revised CheckShoutQuota() --- FICS/talkproc.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'FICS') diff --git a/FICS/talkproc.c b/FICS/talkproc.c index fdc3c24..a5fab0b 100644 --- a/FICS/talkproc.c +++ b/FICS/talkproc.c @@ -63,18 +63,18 @@ int quota_time; -/* hawk: hacked it to fit ALL persons - quota list is not needed anymore */ -int CheckShoutQuota(int p) +// hawk: hacked it to fit ALL persons - quota list is not needed anymore +int +CheckShoutQuota(int p) { - int timenow = time(0); - int timeleft = 0; - - if (((timeleft = timenow - parray[p].lastshout_a) < quota_time) && - (parray[p].adminLevel == 0)) { - return (quota_time - timeleft); - } else { - return 0; - } + int timeleft = 0; + int timenow = time(0); + + timeleft = timenow - parray[p].lastshout_a; + + if (timeleft < quota_time && parray[p].adminLevel == 0) + return (quota_time - timeleft); + return 0; } PUBLIC int -- cgit v1.2.3