[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  request for member `bits' in something not a structure or union
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

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] Refresh page


Posted by Imake13   USA  (10 posts)  [Biography] 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.
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] 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
[Go to top] top

Posted by Kiasyn Kelle   (15 posts)  [Biography] 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
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] 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
[Go to top] 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.


5,050 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]