Re: How do I find out if an Object is a corpse?

From: Graham Gilmore (gilmore@gmgate.vircom.com)
Date: 07/23/95


On Sat, 22 Jul 1995, Jörgen Zigge Sigvardsson wrote:

> How do I find out if an Object is a corpse?
> 
> I'm trying to make a new skill, which allows the player to make a shield, boots,
> gloves, etc. out of corpses. At some point I have to determine if the object, which 
> the player tries to use, is a corpse. There is no ITEM_CORPSE (not in pl8). 
> 
> I know that a corpse is considered as a container, but I can't rely on that since
> a bag is also considered as a container.
> 
> I'd be very glad if someone could tell me how to do it.
> 
> Ziggur @ BlueMage
> 
	
	According to make_corpse() in fight.c, a corpse is a 
TYPE_CONTAINER with value[3] = 1.

	GET_OBJ_TYPE(corpse) = TYPE_CONTAINER;
	...
	GET_OBJ_VAL(corpse, 3) = 1;  /* corpse identifier */


	Graham Gilmore



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