"
<20hp 100m 100mv> checkweaps dagger
1 ) [ AVG DAM: 2 ] [ LEVEL: 0 ] a dagger
----------------
<20hp 100m 100mv> checkweaps null 50
1 ) [ AVG DAM: 24 ] [ LEVEL: 50 ] the sharp teeth of a lawyer
2 ) [ AVG DAM: 24 ] [ LEVEL: 50 ] the Sword of the Sun
3 ) [ AVG DAM: 24 ] [ LEVEL: 50 ] the Thunder Bolt
----------------
<20hp 100m 100mv> checkweaps sword 50
<20hp 100m 100mv>
----------------
<20hp 100m 100mv> checkweaps
1 ) [ AVG DAM: 2 ] [ LEVEL: 0 ] a sub issue dagger
2 ) [ AVG DAM: 7 ] [ LEVEL: 11 ] a steel broad sword
3 ) [ AVG DAM: 7 ] [ LEVEL: 11 ] a steel broad sword
4 ) [ AVG DAM: 5 ] [ LEVEL: 5 ] a short bow
5 ) [ AVG DAM: 5 ] [ LEVEL: 5 ] a short bow
(etc, etc, etc, etc, it works with no arguments)
"
From: "Valnir" <[EMAIL PROTECTED]>
To: <[email protected]>
Subject: Re: a problem im having
Date: Fri, 13 Aug 2004 14:23:33 -0400
Please verify what you entered. There seems to be either missing, or
duplicate text in the function. just as an example, you have two "}" after
the second 'if' statement.
- Valnir
----- Original Message -----
From: "Tristan M" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, August 13, 2004 2:01 PM
Subject: a problem im having
> i wrote this little function to list all the weapons in the game and
their
> average damage, with two options, you can search for options of a
> particular level, particular name, particular name and level, or just
list
> all the objects. my problems are:
> a) that when it tries to list by name(without level) it only shows
weapons
> that are level 0
> b) when it tries to list by name and level it doesnt spit anything out
>
> heres the code, can someone find whats wrong? ive been looking at it and
> just cant figure it out.
>
> void do_checkweaps(CHAR_DATA *ch, char *argument)
> {
> char buf[MAX_INPUT_LENGTH];
> char name[MAX_INPUT_LENGTH];
> char level[MAX_INPUT_LENGTH];
> BUFFER *buffer;
> OBJ_DATA *obj;
> bool found;
> int number = 0;
>
> found = FALSE;
> number = 0;
>
> buffer = new_buf();
>
> argument = one_argument(argument, name);
> argument = one_argument(argument, level);
> if (name[0] == '\0' || ( !str_cmp( name, "null" ) && level[0] ==
'\0'))
> {
> log_string("1");
> for ( obj = object_list; obj != NULL; obj = obj->next )
> {
> if(obj->wear_loc == WEAR_WIELD)
> {
> number++;
> sprintf(buf," %d ) [ AVG DAM: %3d ] [ LEVEL: %3d ] %s\n\r",number,((1 +
> obj->value[2]) * obj->value[1] / 2),obj->level,obj->short_descr);
> add_buf(buffer,buf);
> }
> }
> page_to_char(buf_string(buffer),ch);
> return;
> }
> if (str_cmp( name, "null" ) && level[0] == '\0')
> {
> log_string("2");
> for ( obj = object_list; obj != NULL; obj = obj->next )
> {
> if(str_cmp(name,obj->name))
> continue;
> if(obj->wear_loc == WEAR_WIELD)
> {
> number++;
> sprintf(buf," %d ) [ AVG DAM: %3d ] [ LEVEL: %3d ] %s\n\r",number,((1 +
> obj->value[2]) * obj->value[1] / 2),obj->level,obj->short_descr);
> add_buf(buffer,buf);
> }
> }
> page_to_char(buf_string(buffer),ch);
> return;
> }
> if (!str_cmp( name, "null" ))
> {
> log_string("3");
> for ( obj = object_list; obj != NULL; obj = obj->next )
> {
> if(obj->level != atoi(level))
> continue;
> if(obj->wear_loc == WEAR_WIELD)
> {
> number++;
> sprintf(buf," %d ) [ AVG DAM: %3d ] [ LEVEL: %3d ] %s\n\r",number,((1 +
> obj->value[2]) * obj->value[1] / 2),obj->level,obj->short_descr);
> add_buf(buffer,buf);
> }
> }
> page_to_char(buf_string(buffer),ch);
> return;
> }
> log_string("4");
> for ( obj = object_list; obj != NULL; obj = obj->next )
> {
> if(str_cmp(name,obj->name))
> continue;
> if(obj->level != atoi(level))
> continue;
> if(obj->wear_loc == WEAR_WIELD)
> {
> number++;
> sprintf(buf," %d ) [ AVG DAM: %3d ] [ LEVEL: %3d ] %s\n\r",number,((1 +
> obj->value[2]) * obj->value[1] / 2),obj->level,obj->short_descr);
> add_buf(buffer,buf);
> }
> }
> page_to_char(buf_string(buffer),ch);
> return;
> }
>
> _________________________________________________________________
> Take charge with a pop-up guard built on patented Microsoft® SmartScreen
> Technology
>
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
> Start enjoying all the benefits of MSN® Premium right now and get the
> first two months FREE*.
>
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>
--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom
_________________________________________________________________
Designer Mail isn't just fun to send, it's fun to receive. Use special
stationery, fonts and colors.
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
Start enjoying all the benefits of MSN® Premium right now and get the
first two months FREE*.