#include <sys/stat.h>
#include <time.h>
+#define DUMP_ITEMS 0
+
// === IMPORTS ===
extern tHandler gCoke_Handler;
extern tHandler gSnack_Handler;
#endif
/**
- * \brief Read the initiali item list
+ * \brief Read the initial item list
*/
void Load_Itemlist(void)
{
price = atoi( line + matches[3].rm_so );
desc = line + matches[4].rm_so;
+ #if DUMP_ITEMS
printf("Item '%s' - %i cents, %s:%i\n", desc, price, type, num);
+ #endif
handler = NULL;
for( i = 0; i < giNumHandlers; i ++ )
if( items[i].Handler != handler ) continue;
if( items[i].ID != num ) continue;
+ #if DUMP_ITEMS
printf("Redefinition of %s:%i, updated\n", handler->Name, num);
+ #endif
items[i].Price = price;
free(items[i].Name);
items[i].Name = strdup(desc);
items = realloc( items, (numItems + 1)*sizeof(items[0]) );
items[numItems].Handler = handler;
items[numItems].ID = num;
- items[numItems].Price = price;
+ if( gbNoCostMode )
+ items[numItems].Price = 0;
+ else
+ items[numItems].Price = price;
items[numItems].Name = strdup(desc);
items[numItems].bHidden = (line[0] == '-');
numItems ++;