int newspaper_list(CHAR_DATA *ch, char *argument)
{
NEWSPAPER *news;
int on_stands = -1;
char buf[MAX_STRING_LENGTH];
int count = 0;
if(!str_cmp(argument, "out now") || !str_cmp(argument, "on stands"))
on_stands = 1;
else if(!str_cmp(argument, "off stands")) on_stands = 0;
for(news = paper_list; news; news = news->next)
{
if(on_stands == -1 || news->on_stands == on_stands)
{
sprintf(buf, "[%4d] %-15s $%d.%.2d [%s]\n\r",
count, news->name, news->cost/100,
(news->cost - news->cost/100),
news->on_stands?"On Stands":"Off Stands");
send_to_char(buf, ch);
}
count++;
}
return TRUE;
}
news->cost%100,
news->cost%100,
(news->cost - news->cost/100*100)
I've got a money problem and I'm not clear enough as to why it is doing what it is doing. Here is the what happens:
Syntax: newspaper create <cost_in_cents> <name>
<unhurt> newspaper create 200 The Sentinel
Paper 'The Sentinel' created.
<unhurt>
<unhurt> news list
[ 0] The Sentinel $2.198 [Off Stands]
And here is the code for creating newspapers:
Any thoughts as to why it would be doing that?