Re: [ Code ] Questions about vnums

From: Chris Jacobson (fear@ATHENET.NET)
Date: 09/20/97

On 9/20/97 6:14 PM, John Evans (evansj@HI-LINE.NET) stated:

>> This might sound newbish, but when I hang a spec to one certain object,
>> how do I get to it's VNUM in the spec? *blink*
>In utils.h I have:
>#define GET_OBJ_VNUM(obj)       (GET_OBJ_RNUM(obj) >= 0 ? \
>                                 obj_index[GET_OBJ_RNUM(obj)].virtual : -1)
>I have added tons of useful macros to utils.h, so I don't remember if
>this is a stock one or not.

Actually its a good question.

Most people do not know that the SPEC_PROC standard passes in on the
variable 'me' a pointer to the owner of the proc (Im not sure if it is a
pointer in the case of rooms, or the index in world[]).

So, basically:

GET_OBJ_VNUM((struct obj_data *)me)

Blessed Be!

- Chris Jacobson

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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