From 00f47de18c9b8462fc21ad16d89f257c96d2e6be Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 27 Apr 2012 11:27:41 +0800 Subject: [PATCH] Server - Changed logging to note when a test dispense is done --- src/server/dispense.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/server/dispense.c b/src/server/dispense.c index b0a5936..b05c81c 100644 --- a/src/server/dispense.c +++ b/src/server/dispense.c @@ -68,10 +68,21 @@ int DispenseItem(int ActualUser, int User, tItem *Item) actualUsername = Bank_GetAcctName(ActualUser); // And log that it happened - Log_Info("dispense '%s' (%s:%i) for %s by %s [cost %i, balance %i]", - Item->Name, handler->Name, Item->ID, - username, actualUsername, Item->Price, Bank_GetBalance(User) - ); + if( gbNoCostMode ) + { + // Special format for zero cost dispenses + Log_Info("test dispense '%s' (%s:%i) for %s by %s [no change]", + Item->Name, handler->Name, Item->ID, + username, actualUsername + ); + } + else + { + Log_Info("dispense '%s' (%s:%i) for %s by %s [cost %i, balance %i]", + Item->Name, handler->Name, Item->ID, + username, actualUsername, Item->Price, Bank_GetBalance(User) + ); + } free( username ); free( actualUsername ); -- 2.20.1