]> jfr.im git - irc/quakenet/newserv.git/commitdiff
fix bug in G stats
authorPaul <redacted>
Sun, 23 Nov 2008 21:53:42 +0000 (21:53 +0000)
committerPaul <redacted>
Sun, 23 Nov 2008 21:53:42 +0000 (21:53 +0000)
--HG--
branch : paul

helpmod2/hcommands.c
helpmod2/hstat.c

index 35d138c5b8091b04816893350190951685ebc224..050bed425268b3f2055d54fdb3b31016e57ecfa1 100644 (file)
@@ -2037,12 +2037,14 @@ static void helpmod_cmd_activestaff (huser *sender, channel* returntype, char* o
     switch (listtype)
     {
     case 0:
-        for (i=0;i < arr.arrlen && arr.array[i].prime_time_spent > H_ACTIVE_LIMIT;i++)
-            helpmod_reply(sender, returntype, "#%-2d %-20s %-20s %-20s", i+1,((haccount*)(arr.array[i].owner))->name->content, helpmod_strtime(arr.array[i].prime_time_spent), helpmod_strtime(arr.array[i].time_spent));
+        for (i=0;i < arr.arrlen;i++)
+            if (arr.array[i].prime_time_spent > H_ACTIVE_LIMIT)
+                helpmod_reply(sender, returntype, "#%-2d %-20s %-20s %-20s", i+1,((haccount*)(arr.array[i].owner))->name->content, helpmod_strtime(arr.array[i].prime_time_spent), helpmod_strtime(arr.array[i].time_spent));
         break;
     case 1:
-        for (i=arr.arrlen-1;i >= 0 && arr.array[i].prime_time_spent < H_ACTIVE_LIMIT;i--)
-            helpmod_reply(sender, returntype, "#%-2d %-20s %-20s %-20s", (arr.arrlen - i),((haccount*)(arr.array[i].owner))->name->content, helpmod_strtime(arr.array[i].prime_time_spent), helpmod_strtime(arr.array[i].time_spent));
+        for (i=arr.arrlen-1;i >= 0;i--)
+            if (arr.array[i].prime_time_spent < H_ACTIVE_LIMIT)
+                helpmod_reply(sender, returntype, "#%-2d %-20s %-20s %-20s", (arr.arrlen - i),((haccount*)(arr.array[i].owner))->name->content, helpmod_strtime(arr.array[i].prime_time_spent), helpmod_strtime(arr.array[i].time_spent));
         break;
     }
 
@@ -3510,7 +3512,8 @@ static void helpmod_cmd_weekstats (huser *sender, channel* returntype, char* ost
 
     helpmod_reply(sender, returntype, "Weekly statistics for %ss on channel %s", hlevel_name(lvl), hchannel_get_name(hchan));
 
-    for (i=0;i < arr.arrlen && arr.array[i].time_spent > HDEF_m;i++)
+    for (i=0;i < arr.arrlen;i++)
+      if (arr.array[i].time_spent > HDEF_m)
        helpmod_reply(sender, returntype, "%-20s %-20s %-20s",((haccount*)(arr.array[i].owner))->name->content, helpmod_strtime(arr.array[i].prime_time_spent), helpmod_strtime(arr.array[i].time_spent));
 
     free(arr.array);
index bcc3762e7181072a7d798b56046d3daadec75cf1..c879797b9894544404cdefbad2e502b6f02d8205 100644 (file)
@@ -335,7 +335,7 @@ hstat_channel_entry hstat_channel_last_month(hstat_channel *hs_chan)
 
 static int hstat_account_compare(hstat_account_entry_sum *e1, hstat_account_entry_sum *e2)
 {
-    return e2->prime_time_spent - e1->prime_time_spent;
+    return e2->time_spent - e1->time_spent;
 }
 
 hstat_accounts_array create_hstat_account_array(hchannel *hchan, hlevel lvl, hstat_account_array_type type)