Re: Equipment and obj pointers

From: Steve (quickey@cyberverse.com)
Date: 03/30/96


On Sat, 30 Mar 1996, Graham Gilmore wrote:

> 	I want to make some changes to objects and wear locations, so 
> that I can implement worn items which cover more than one location (eg: a 
> plate armor which covers body, legs, arms, head, etc.).  However, I have 
> a choice available.
> 	I can either include pointers in a location structure pointing to 
> the next location upon which the object in question is worn.  While this 
> seems simple, I have also made changes allowing for multiple objects (of 
> different kinds) to be worn on the same location; 4 types, to be 
> precise.  This solution would require 4 different "next" pointers.  
> 	The other solution is simply to have each location in question 
> point to the same object.  Now this is simpler, but I'm a bit leery of 
> having multiple wear locations pointing to one object; I can imagine 
> strange events if say I removed the object from one location but forgot 
> to remove it from another....  Is this solution as error-prone as it 
> seems to be, or should I have no worries about it?  My common sense tells 
> me the first solution is the way to go, but I've been wrong before.  I'd 
> rather not stick in the extra 4 pointers per location per character, if I 
> don't have to.. I've already inflated the memory requirements for a 
> char_data enough as it is :)

What I did for body and 2 handed locations is just make a whole new 
location for BODY and 2HANDED, and then in perform_wear() i check if 
you're wearing something on arms/legs/chest, if so, you cannot wear body 
eq, and if you're wearing body eq you cant wear arms/legs/chest eq, just 
a few simple

if ((where == WEAR_BODY) && (GET_EQ(ch, WEAR_ARMS) || GET_EQ(ch, WEAR_LEGS) || GET_EQ(ch, WEAR_CHEST))) {
   send_to_char("You are already wearing something on your arms/legs/chest.\r\n", ch);
   return;
}
not sure if thats the exact code, but its somewhat like that



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