NodeMetadata *metap = map->getNodeMetadata(p);
if (metap) {
std::ostringstream os(std::ios::binary);
- metap->serialize(os);
+ metap->serialize(os, 1); // FIXME: version bump??
meta = os.str();
}
}
}
}
std::istringstream is(n_old.meta, std::ios::binary);
- meta->deSerialize(is);
+ meta->deSerialize(is, 1); // FIXME: version bump??
}
// Inform other things that the meta data has changed
v3s16 blockpos = getContainerPos(p, MAP_BLOCKSIZE);
case TYPE_MODIFY_INVENTORY_STACK: {
InventoryLocation loc;
loc.deSerialize(inventory_location);
- std::string real_name = gamedef->idef()->getAlias(inventory_stack.name);
Inventory *inv = imgr->getInventory(loc);
if (!inv) {
infostream << "RollbackAction::applyRevert(): Could not get "
<< inventory_location << std::endl;
return false;
}
+
// If item was added, take away item, otherwise add removed item
if (inventory_add) {
// Silently ignore different current item
- if (list->getItem(inventory_index).name != real_name)
+ if (list->getItem(inventory_index).name !=
+ gamedef->idef()->getAlias(inventory_stack.name))
return false;
list->takeItem(inventory_index, inventory_stack.count);
} else {