P_ITEM cChar::getShield()
{
	P_ITEM pi=GetItemOnLayer(2);
	if (pi && IsShield(pi->id()) )
		return pi;
	else
		return NULL;
}
Beispiel #2
0
    void UCorpse::add(Item *item) {
        // When an item is added, check if it's equippable and add to the appropriate layer        
        if (Items::valid_equip_layer(item) && GetItemOnLayer(item->tile_layer) == NULL)
        {
            PutItemOnLayer(item);
        }

        // plus the defaults from UContainer
        base::add(item);
    }
Beispiel #3
0
    void UCorpse::remove(iterator itr)
    {
        Item *item = GET_ITEM_PTR(itr);

        if (Items::valid_equip_layer(item))
        {
            Item* item_on_layer = GetItemOnLayer(item->tile_layer);
            
            if (item_on_layer != EMPTY_ELEM && item_on_layer->serial == item->serial)
            {
                RemoveItemFromLayer(item);
            }
        }
        base::remove(itr);
    }