Re: How Exactly does in_room work

From: ShadowLord (dkoepke@california.com)
Date: 02/21/96


<in_room> is the REAL number of the room the person is in.  Virtual 
numbers are used in the database for grouping together things in a zone 
(well, I am sure there are other reasons for them), when they are loaded, 
it uses real_room(vnum) (I believe that was it) to make them into 
sequential numbers one after the next starting with the first vnum 
encountered so that it can be used properly with "world[xxxxx]" (and, 
once again, there's probably more reasons).  Thus, 

ch->in_room = real_room(3001) 
And, 
ch->in_room = 3001;

Are quite different, the same as: world[real_room(1204)] is right and,  
world[1204] is wrong (unless you have at least 1204 rooms, this will result 
in going past the end of the structure and (I'm fairly certain) a seg 
fault...


--
Hope this helps,
Daniel Koepke <dkoepke@california.com>/<trice@dstar.california.com>
Creator of DivinityMUD (in development)



This archive was generated by hypermail 2b30 : 12/07/00 PST