Re: How Exactly does in_room work

From: Sammy (samedi@clark.net)
Date: 02/21/96


On Wed, 21 Feb 1996, Brian Jones wrote:

> ch->in_room usualy references the room the player is in. Before I had 
> thought that this was the vnum. If you where in room 3001 then 
> ch->in_room was equal to 3001
> 
> But after having trouble with the code I'm doing now I decided to print 
> ch->in_room at the begining of the procedure to see what it was equal 
> to.. two rooms 3012 and 3018 I think had ch->in_room to be 38 and 42..
> 
> So how do I calculate ch->in_room? Does it change for one room when 
> modifications are made to the zone or more zones added? And I haven't 
> found yet how to reference the vnum of the room directly (I probably will 
> soon) but I'd like to know how ch->in_room works ... thanks for any help 
> in advance.

When circle reads the rooms, mobs, and objects into memory, it converts 
them to real numbers (though saving a reference to the correct virtual 
number).  ch->in_room is a real number, meaning if you're in room 3001 
and 3001 was the 30th room read into the system, ch->in_room will be 30.  
To get the virtual room number, use real_room(ch->in_room).  You can also 
get it from the variable world[ch->in_room].number.

Sam



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