Fixed sleep (darn order of subtraction) :)
authorJohn Hodge <[email protected]>
Thu, 3 Mar 2011 13:31:57 +0000 (21:31 +0800)
committerJohn Hodge <[email protected]>
Thu, 3 Mar 2011 13:31:57 +0000 (21:31 +0800)
src/server/handler_coke.c

index 8c82a07..58e3b79 100644 (file)
@@ -204,7 +204,9 @@ int Coke_DoDispense(int UNUSED(User), int Item)
        // Make sure there are not two dispenses within n seconds
        if( time(NULL) - gtCoke_LastDispenseTime < 10 )
        {
-               sleep( 10 - time(NULL) - gtCoke_LastDispenseTime );
+               printf("Wait %li seconds?\n", 10 - (time(NULL) - gtCoke_LastDispenseTime));
+               sleep( 10 - (time(NULL) - gtCoke_LastDispenseTime) );
+               printf("wait done\n");
        }
        
        // LOCK

UCC git Repository :: git.ucc.asn.au