Personally I would suggest installing a chprintf or some kind of sprintf
Rather than using one_argument to split the obj->name into the buffer.
To me it just doesn't seem like a very good way to do it... really I would
Do something more like..
send_to_char( ".\n\rObjects: ", ch );
for ( obj = location->contents; obj; obj = obj->next_content )
{
sprintf( buf, "%s", obj->name );
if (obj->next_content)
sprintf( buf, " ");
else
sprintf( buf, ".\n\r");
}
send_to_char( buf, ch );
I think it may be causing problems trying to pull it off using one_argument,
but either way I think this is a more efficient better way of doing it,
although you could also use a chprintf and avoid the need for the buffer at
all, either way you want to do it.
send_to_char( ".\n\rObjects: ", ch );
for ( obj = location->contents; obj; obj = obj->next_content )
{
chprintf( ch, "%s", obj->name );
if (obj->next_content)
chprintf( ch, " ");
else
chprintf( ch, ".\n\r");
}
I hope this helps.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jesse
Boulianne
Sent: Tuesday, June 29, 2004 5:25 PM
To: [email protected]
Subject: do_rstat
I've been staring at this little section of code for hours now and I still
can't figure it out. Maybe it's because I'm looking for something much more
complicated than what it truly is, or maybe I'm just daft. Whatever the
reason, I can't seem to fix it.
Would someone be so kind as to explain to me why
send_to_char( ".\n\rObjects: ", ch );
for ( obj = location->contents; obj; obj = obj->next_content )
{
send_to_char( " ", ch );
one_argument( obj->name, buf );
send_to_char( buf, ch );
}
send_to_char( ".\n\r", ch );
spits out:
Name: 'Belton Square'
Area: 'City of Belton'
Vnum: 100 Sector: city Light: 1 Healing: 100 Mana: 100
Room flags: no_mob.
Material: none
Collectable: 0
Description:
Characters: raythen.
Objects: fountain.
¥N¸è
On my screen. Note the strange ascii characters below "Objects".
Not only the solution, an explanation about what I've done, and a swift whap
up the side of my head, would be greatly appreciated.
TIA
!!!!!
( o o )
----oOO----(_)----OOo----
Jesse B
----ooO-----------Ooo----
--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom