Ejemplo n.º 1
0
void cWSSAnvil::LoadDropperFromNBT(cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx)
{
    ASSERT(a_NBT.GetType(a_TagIdx) == TAG_Compound);
    int x, y, z;
    if (!GetBlockEntityNBTPos(a_NBT, a_TagIdx, x, y, z))
    {
        return;
    }
    int Items = a_NBT.FindChildByName(a_TagIdx, "Items");
    if ((Items < 0) || (a_NBT.GetType(Items) != TAG_List))
    {
        return;  // Make it an empty dropper - the chunk loader will provide an empty cDropperEntity for this
    }
    std::auto_ptr<cDropperEntity> Dropper(new cDropperEntity(x, y, z, m_World));
    LoadItemGridFromNBT(Dropper->GetContents(), a_NBT, Items);
    a_BlockEntities.push_back(Dropper.release());
}
Ejemplo n.º 2
0
Archivo: move.c Proyecto: chazu/btmux
static void process_sticky_dropto(dbref loc, dbref player)
{
	dbref dropto, thing, next;

	/*
	 * Do nothing if checking anything but a sticky room 
	 */

	if(!Good_obj(loc) || !Has_dropto(loc) || !Sticky(loc))
		return;

	/*
	 * Make sure dropto loc is valid 
	 */

	dropto = Dropto(loc);
	if((dropto == NOTHING) || (dropto == loc))
		return;

	/*
	 * Make sure no players hanging out 
	 */

	DOLIST(thing, Contents(loc)) {
		if(Dropper(thing))
			return;
	}

	/*
	 * Send everything through the dropto 
	 */

	s_Contents(loc, reverse_list(Contents(loc)));
	SAFE_DOLIST(thing, next, Contents(loc)) {
		send_dropto(thing, player);
	}