Compiling FUSS 1.6 Weapon code compilation errors

Posted by Dralnu on Thu 08 Sep 2005 06:38 PM — 8 posts, 29,390 views.

USA #0
make -s smaug
  Compiling o/skills.o....
skills.c: In function `ranged_got_target':
skills.c:4767: error: parameter `wtype' is initialized
skills.c:4767: error: parm types given both in parmlist and separately
skills.c:4848: error: `wtype' undeclared (first use in this function)
skills.c:4848: error: (Each undeclared identifier is reported only once
skills.c:4848: error: for each function it appears in.)
make[1]: *** [o/skills.o] Error 1
make: *** [all] Error 2


OK, this is Samson's Weapons code. I don't see where to declare wtype for ranged_got_target. I did what the directions said to, but seem to be lacking a declaration. Where am I missing this declare? I don't see anything for it in mud.h (I'll try moving part of the code there to see how that works, but I don't think that will work).
USA #1
moved the declare to mud.h, and it didn't help (I added the code directly to the section after /*skills.c*/), Where else would it need to be declared?
USA #2
What does the prototype for ranged_got_target look like in skills.c?
USA #3
Hmm. I have the new system on my MUD and it's fine. It's in archery.c for me. I have this:
ch_ret ranged_got_target( CHAR_DATA * ch, CHAR_DATA * victim, OBJ_DATA * weapon, OBJ_DATA * projectile, short dist, short dt,
                          char *stxt, short color )
{
   /*
    * added wtype for check to determine skill used for ranged attacks - Grimm
    */
   short wtype = 0;
USA #4
/*
 * Perform the actual attack on a victim			-Thoric
 */
ch_ret ranged_got_target( CHAR_DATA * ch, CHAR_DATA * victim, OBJ_DATA * weapon,
                          OBJ_DATA * projectile, short dist, short dt, char *stxt, short color )
/* added wtype for check to determine skill used for ranged attacks - Grimm */
    short wtype = 0;
{


that is the code from the start of it. That what you needed?
USA #5
That's your problem. wtype is before the opening bracket.
USA #6
Well, there you go... look at where the 'short' is and look at where the { is...


EDIT: Heh, beat me to it by a few seconds! :-)
USA #7
lol. Fixed it. Looking at Zeno's bit, the { was in the wrong location. Changed it and it went up fine. I hate parenthese/brackets...

If only I had a dollar

I changed it before both of you posted, oddly enough. LOL