Exemplo n.º 1
0
void Item::copyAttributes(Item* item)
{
	if(item && item->attributes && !item->attributes->empty())
	{
		createAttributes();
		*attributes = *item->attributes;
	}

	eraseAttribute("decaying");
	eraseAttribute("duration");
}
Exemplo n.º 2
0
void Item::setID(uint16_t newId)
{
	const ItemType& it = Item::items[newId];
	const ItemType& pit = Item::items[id];
	id = newId;

	uint32_t newDuration = it.decayTime * 1000;
	if(!newDuration && !it.stopTime && it.decayTo == -1)
	{
		eraseAttribute("decaying");
		eraseAttribute("duration");
	}

	eraseAttribute("corpseowner");
	if(newDuration > 0 && (!pit.stopTime || !hasIntegerAttribute("duration")))
	{
		setDecaying(DECAYING_FALSE);
		setDuration(newDuration);
	}
}
Exemplo n.º 3
0
void Item::resetActionId(bool callEvent/* = true*/)
{
	if(!getActionId())
		return;

	Tile* tile = NULL;
	if(callEvent)
		tile = getTile();

	eraseAttribute("aid");
	if(tile)
		g_moveEvents->onAddTileItem(tile, this);
}
Exemplo n.º 4
0
void BedItem::internalRemoveSleeper()
{
	sleeper = 0;
	eraseAttribute("sleepstart");
	setSpecialDescription("Nobody is sleeping there.");
}