Please i need a littl help with this...
( iv added a edit to this to point out the lines thats causing the error)
heres the problem:
undefined refrence to _free_string
then the usal error2
What i want to know is is there a fix for this or some other way of renaming items? (this is for mortals and i dont want them let lose with oedit) any help would be great thankx
(oh this code is part rom so if that helps the problem?)
Rash
( iv added a edit to this to point out the lines thats causing the error)
void do_restring (CHAR_DATA * ch, char *argument)
{
int i;
long cost;
OBJ_DATA *obj;
char arg1[MAX_INPUT_LENGTH]; /*Object*/
char string_where[MAX_INPUT_LENGTH];
char *string;
bool errors, isName;
isName = FALSE;
errors = FALSE;
cost = 250000;
/*Gold check*/
if ((ch->gold - cost) < 0)
{
send_to_char("You're poor! Get a job, you shiftless bum!\n\r", ch); return;
}
if ( argument == NULL || argument[0] == '\0' )
return;
smash_tilde (argument);
argument = one_argument (argument, arg1);
argument = one_argument (argument, string_where);
string = argument;
if ((obj = get_obj_carry (ch, arg1)) == NULL)
{
send_to_char ("You aren't carrying that object.\n\r", ch);
return;
}
/* Sanity check for empty strings */
if( string == NULL || string[0] == '\0'){
send_to_char("You have to provide a string, smartypants!\n\r", ch);
return;
}
/*Don't allow colors at all in 'name' for objects'*/
if (!str_prefix(string_where, "name"))
isName = TRUE;
/* Start looping through *string */
for(i = 0; i < strlen(string); i++)
{
/* When the end is reached, break.*/
if(string[i] == '\0') {
break;
}
/* If string[i] isn't '&', then continue.
* Placed here to save time as most chars won't be.
*/
else if(string[i] != '&' ) {
continue;
}
else if(string[i] == '&' && isName) {
{errors = TRUE; break;}
}
/* If string[i] is '&' and string[i+1] is '\0'
* Whoa, wrong, return. It'll bleed. For example, string{ .
*/
else if (string[i] == '&' && string[i+1] == '\0' ) {
send_to_char("That string will colorbleed--please"
" end your strings with &g.\n\r", ch);
return;
}
/* If string[i] is '&' and string[i+1] isn't '\0', but
* string[i+2] is \0. If so, we need to make sure that
* the color won't bleed.
*/
else if (string[i] == '&' && string[i+1] != '\0' && string[i+2] == '\0')
{
/* All done*/
if (string[i+1] == 'g')
break;
else
/*Color bleeding (string&& or string&g for example)*/
{
send_to_char("That string will colorbleed--please"
" end your strings with &g.\n\r", ch);
return;
}
}
/* Isn't needed, but makes me feel better ;)
*/
else { continue; }
}
if (errors)
{
send_to_char("Colors are not allowed in the name of an object.\n\r", ch);
return;
}
if (!str_prefix (string_where, "name"))
{
<ERROR - its the free_String)> free_string (obj->name);
obj->name = str_dup (string);
}
else if (!str_prefix (string_where, "short"))
{
<ERROR - its the free_String)> free_string (obj->short_descr);
obj->short_descr = str_dup (string);
}
else if (!str_prefix (string_where, "long"))
{
<ERROR - its the free_String)> free_string (obj->description);
obj->description = str_dup (string);
}
else
{
send_to_char("The commissary man stares blankly at you for a moment before finally pointing at a sign on the wall labeled 'help autostring'.\n\r",ch);
return;
}
ch->gold -= cost;
send_to_char("All done!\n\r",ch);
return;
}
heres the problem:
undefined refrence to _free_string
then the usal error2
What i want to know is is there a fix for this or some other way of renaming items? (this is for mortals and i dont want them let lose with oedit) any help would be great thankx
(oh this code is part rom so if that helps the problem?)
Rash