Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ request for member `bits' in something not a structure or union

request for member `bits' in something not a structure or union

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Imake13   USA  (10 posts)  Bio
Date Fri 29 Dec 2006 06:04 AM (UTC)
Message
hi guys... i tried adding the snippet:

Shows Exits as:
Normal: south
Closed: [south]
Locked: [south]
DT : ***SOUTH***

void do_exits( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
EXIT_DATA *pexit;
bool found, closed=FALSE, locked=FALSE, DT=FALSE;
bool fAuto;
int spaces;

set_char_color( AT_EXITS, ch );
fAuto = !str_cmp( argument, "auto" );

if ( !check_blind(ch) )
return;

strcpy( buf, fAuto ? "&WExits:" : "&WObvious exits:\n\r" );

found = FALSE;
for ( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next )
{
if ( pexit->to_room
&& !IS_SET(pexit->exit_info, EX_SECRET)
&& (!IS_SET(pexit->exit_info, EX_WINDOW)
|| IS_SET(pexit->exit_info, EX_ISDOOR))
&& !IS_SET(pexit->exit_info, EX_HIDDEN) )
{
found = TRUE;
closed = IS_SET(pexit->exit_info, EX_CLOSED);
locked = (IS_SET(pexit->exit_info, EX_LOCKED) || IS_SET(pexit->exit_info, EX_BOLTED) );
DT = ((IS_IMMORTAL(ch) || IS_AFFECTED(ch, AFF_DETECTTRAPS)) && xIS_SET(pexit->to_room->room_flags, ROOM_DEATH));

if ( fAuto )
{
sprintf( buf, "%s %s" "%s" "&W" "%s", buf,
DT? "&R***" : !closed ? "" : locked ? "&R[&W" : "[",
DT ? strupper(dir_name[pexit->vdir]): dir_name[pexit->vdir],
DT? "&R***&W" : !closed ? "" : locked ? "&R]&W" : "]");
}
else
{
/* I don't want to underline spaces, so I'll calculate the number we need */
spaces = 5 - strlen (dir_name[pexit->vdir]);
if (spaces < 0)
spaces = 0;
sprintf( buf + strlen(buf), "%s" "%*s - %s\n\r",
capitalize( dir_name[pexit->vdir] ),
spaces, /* number of spaces */
"",
DT ? "&RYou sense an aura of imminent doom this way&W" : locked ? "&R[&WClosed and Locked/Barred&R]&W" : closed ? "[Closed]" : room_is_dark( pexit->to_room ) ? "Too dark to tell" : pexit->to_room->name );
}
}
}

if ( !found )
strcat( buf, fAuto ? " none.\n\r" : "None.\n\r" );
else
if ( fAuto )
strcat( buf, ".\n\r" );
send_to_char( buf, ch );
return;
}



it doesn't say where it goes but after some searching around if found the do_exits in the act_info.c file.


So i added this and compiled... I got this error:

Compiling o/act_info.o....
act_info.c: In function `do_exits':
act_info.c:1793: request for member `bits' in something not a structure or union
act_info.c:1793: called object is not a function
make[1]: *** [o/act_info.o] Error 1
make: *** [all] Error 2



any help would be appreciated.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Fri 29 Dec 2006 07:01 AM (UTC)
Message
What line is 1793?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Kiasyn Kelle   (15 posts)  Bio
Date Reply #2 on Wed 03 Jan 2007 06:21 AM (UTC)
Message
DT = ((IS_IMMORTAL(ch) || IS_AFFECTED(ch, AFF_DETECTTRAPS)) && xIS_SET(pexit->to_room->room_flags, ROOM_DEATH));

i bet its that line

IS_SET instead of xIS_SET
Top

Posted by Nick Cash   USA  (626 posts)  Bio
Date Reply #3 on Wed 03 Jan 2007 06:55 PM (UTC)
Message
Did you change room_flags in mud.h to be of type EXT_BV or whatever the type is? Otherwise room_flags is just an integer and does indeed have no "bits" member.

~Nick Cash
http://www.nick-cash.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,165 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.