Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, DotBot, Sogou, Yahoo!

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » Reverse Exit
Forum Rules | Mark all | Recent Posts

Reverse Exit
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Feb 16, 2010, 9:12 am
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

I'm trying to acquire the reverse of a given exit, say, if supplied with west, it'll return east, where west is 3 and east is 1. Between rev_dir[] and get_exit_to(), I believe there is a simple way to do it, but without proper comments on the functions I have been unable to figure it out.
       
Post is unread #2 Feb 16, 2010, 9:26 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Something like:
int exit_num = <whatever>;
EXIT_DATA* exit = get_exit(current_room, exit_num);
ROOM_INDEX_DATA* to_room = exit->to_room;
ROOM_INDEX_DATA* from_room = get_exit(to_room, rev_dir[exit_num]);
printf(to_room == from_room);


See also find_door for how to resolve exit names to exit numbers. (That should really be in its own function, but whatever.)
       
Post is unread #3 Feb 16, 2010, 9:46 am
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

Marvelous. I appreciate it.
       
Pages:<< prev 1 next >>