for (std::vector<std::pair<std::string, std::string> >::iterator
j = pairs.begin();
j != pairs.end(); ++j) {
- if (item.name == craftGetItemName(j->first, gamedef)) {
+ if (inputItemMatchesRecipe(item.name, j->first, gamedef->idef())) {
if (item.count == 1) {
item.deSerialize(j->second, gamedef->idef());
found_replacement = true;
{
std::ostringstream os(std::ios::binary);
os << "{ ";
+ unsigned int x = 0;
for(std::vector<std::string>::size_type i = 0;
- i < items.size(); i++) {
- if (i == width) {
+ i < items.size(); i++, x++) {
+ if (x == width) {
os << "; ";
- i = 0;
- } else if (i != 0) {
+ x = 0;
+ } else if (x != 0) {
os << ",";
}
os << '"' << items[i] << '"';
{
std::ostringstream os(std::ios::binary);
os << "{ ";
+ unsigned int x = 0;
for (std::vector<ItemStack>::size_type i = 0;
- i < items.size(); i++) {
- if (i == width) {
+ i < items.size(); i++, x++) {
+ if (x == width) {
os << "; ";
- i = 0;
- } else if (i != 0) {
+ x = 0;
+ } else if (x != 0) {
os << ",";
}
os << '"' << (items[i].getItemString()) << '"';
{
std::ostringstream os(std::ios::binary);
os << "Crafting definitions:\n";
- for (int type = 0; type <= craft_hash_type_max; type++) {
+ for (int type = 0; type <= craft_hash_type_max; ++type) {
for (std::map<u64, std::vector<CraftDefinition*> >::const_iterator
it = (m_craft_defs[type]).begin();
- it != (m_craft_defs[type]).end(); it++) {
+ it != (m_craft_defs[type]).end(); ++it) {
for (std::vector<CraftDefinition*>::size_type i = 0;
i < it->second.size(); i++) {
os << "type " << type
}
virtual void clear()
{
- for (int type = 0; type <= craft_hash_type_max; type++) {
+ for (int type = 0; type <= craft_hash_type_max; ++type) {
for (std::map<u64, std::vector<CraftDefinition*> >::iterator
it = m_craft_defs[type].begin();
- it != m_craft_defs[type].end(); it++) {
+ it != m_craft_defs[type].end(); ++it) {
for (std::vector<CraftDefinition*>::iterator
iit = it->second.begin();
iit != it->second.end(); ++iit) {