diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-04-14 14:21:53 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-04-14 14:21:53 +0200 |
commit | 2e54a7e7c773615f8ff7dc2ef2b4ba8656ee8f4f (patch) | |
tree | cd5609bcf05d70f65d46c586b8e9ff75a2a1e8b1 /FICS | |
parent | 67431b9f231719ddb7cb0dc3b749b002afe0280f (diff) |
Revised CheckShoutQuota()
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/talkproc.c | 22 |
1 files changed, 11 insertions, 11 deletions
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 |