17 Mar, 2007, Brinson wrote in the 1st comment:
Votes: 0
/* allows a prog command to destroy number of items on target victim *
* Syntax: destroy [obj/ch] <target> <item> <number>
* item can be name or vnum
* ex: mob destroy obj chest vial 2
*/
void prog_destroy( ROOM_INDEX_DATA* room, char* argument ){
OBJ_DATA* list = NULL;
char type[MIL];
char target[MIL];
char item[MIL];

void* tar = NULL;
CHAR_DATA* ch_tar = NULL;

if (IS_NULLSTR(argument) || room == NULL){
return;
}
argument = one_argument( argument, type );
argument = one_argument( argument, target );
argument = one_argument( argument, item );

if (IS_NULLSTR(type)){
bug("prog_destroy: null type", 0);
return;
}
else if (IS_NULLSTR(target)){
bug("prog_destroy: null target", 0);
return;
}
else if (IS_NULLSTR(item)){
bug("prog_destroy: null item", 0);
return;
}
else if (room == NULL){
bug("prog_destroy: null room", 0);
return;
}

/* get our target */
if (!str_cmp( type, "obj")){
if ( ((OBJ_DATA*) tar = get_obj_here( NULL, room, target)) == NULL){ <————-
bug("prog_destroy: obj target not found.", 0);
return;
}
else{
list = (OBJ_DATA*) tar;
list = list->contains;
}
}
else if (!str_cmp( type, "ch")){
if ( ((CHAR_DATA*) tar = get_char_room( NULL, room, target)) == NULL){ <————-
bug("prog_destroy: ch target not found.", 0);
return;
}
else{
ch_tar = (CHAR_DATA*) tar;
list = ch_tar->carrying;
}
}
else{
bug("prog_destroy: invalid target, must be obj or ch", 0);
return;
}
/* get our items to destroy */
if (list == NULL){
bug("prog_destroy: List was NULL!", 0);
return;
}
_destroy_items( list, item, atoi(item), atoi(argument), 0 );
}


The bolded line are coming up as:

mob_cmds.c:2358: error: invalid lvalue in assignment
mob_cmds.c:2368: error: invalid lvalue in assignment

From what I've been told by a friend, its because its changing the output type temporarily or something and tar needs to be declared seperately from the if, but being relatively new to coding C I don't entirely understand that. Is there anyone that would be so nice as to help me out with what is the LAST error I've come up with(dozens of warnings still, but I'll deal with those later).
17 Mar, 2007, Brinson wrote in the 2nd comment:
Votes: 0
heh, APPARENTLY bold doesn't work in code tags…hrm…


Edit: I put big ascii <—- thingy mabobbers

Edit: hah, lines would have been easier…you're right.
17 Mar, 2007, Zeno wrote in the 3rd comment:
Votes: 0
Nope, but the lines are labeled so you can just say which lines. ;)
17 Mar, 2007, Guest wrote in the 4th comment:
Votes: 0
if ( ((OBJ_DATA*) tar = get_obj_here( NULL, room, target)) == NULL)

if ( ((CHAR_DATA*) tar = get_char_room( NULL, room, target)) == NULL)


These two lines are not valid constructs in more recent compilers. The cast on the left side of the equal sign is bad. That means that the code needs to be written differently in order to work however it's intended to.
17 Mar, 2007, Tyche wrote in the 5th comment:
Votes: 0
Should be…
if ( ( tar = (void*)get_obj_here( NULL, room, target)) == NULL)

if ( ( tar = (void*)get_char_room( NULL, room, target)) == NULL)


Cast makes no sense on the lvalue. That isn't valid in older gcc compilers either.
17 Mar, 2007, Guest wrote in the 6th comment:
Votes: 0
I've seen older compilers accept the invalid cast before though. I cold swear this changed with gcc4 ( rightly so btw ) since we had to log a SmaugFUSS fix for it in act_move.c with the virtual room code.
17 Mar, 2007, Kasji wrote in the 7th comment:
Votes: 0
lvalue casts is deprecated, but it was once possible to cast lvalues. Being deprecated though, it should not be used now days, and probably doesn't even work.
18 Mar, 2007, Brinson wrote in the 8th comment:
Votes: 0
heh, I fixed each individual error or took out parts I couldn't fix, got it to compile…just won't start, doesn't even spit out errors.

I'm just going to use cygwin and compile it using an earlier version of gcc until I become more adept at coding and and can solve these issues more easily.
19 Mar, 2007, Omega wrote in the 9th comment:
Votes: 0
gdb the program.

should be like this..

gdb
file ../src/<exec-name>
run <port number>

See what gdb brings up, the mud may not drop errors, but i'm sure gdb will catch some. :)
0.0/9