fixing getItemBaseValue() for cheese, sheets and instruments

develop
Vitaly Pronkin 2017-06-26 09:17:23 +12:00 committed by GitHub
parent fe8be90992
commit 6af5f3b299
1 changed files with 19 additions and 6 deletions

@ -1062,7 +1062,6 @@ int Items::getItemBaseValue(int16_t item_type, int16_t item_subtype, int16_t mat
case item_type::CHAIN: case item_type::CHAIN:
case item_type::FLASK: case item_type::FLASK:
case item_type::GOBLET: case item_type::GOBLET:
case item_type::INSTRUMENT:
case item_type::TOY: case item_type::TOY:
case item_type::CAGE: case item_type::CAGE:
case item_type::BARREL: case item_type::BARREL:
@ -1162,10 +1161,13 @@ int Items::getItemBaseValue(int16_t item_type, int16_t item_subtype, int16_t mat
case item_type::MEAT: case item_type::MEAT:
case item_type::PLANT: case item_type::PLANT:
case item_type::PLANT_GROWTH: case item_type::PLANT_GROWTH:
case item_type::CHEESE:
value = 2; value = 2;
break; break;
case item_type::CHEESE:
value = 10;
break;
case item_type::FISH: case item_type::FISH:
case item_type::FISH_RAW: case item_type::FISH_RAW:
case item_type::EGG: case item_type::EGG:
@ -1222,6 +1224,10 @@ int Items::getItemBaseValue(int16_t item_type, int16_t item_subtype, int16_t mat
value = 7; value = 7;
break; break;
case item_type::SHEET:
value = 5;
break;
case item_type::PANTS: case item_type::PANTS:
if (size_t(item_subtype) < world->raws.itemdefs.pants.size()) if (size_t(item_subtype) < world->raws.itemdefs.pants.size())
value = world->raws.itemdefs.pants[item_subtype]->value; value = world->raws.itemdefs.pants[item_subtype]->value;
@ -1250,16 +1256,23 @@ int Items::getItemBaseValue(int16_t item_type, int16_t item_subtype, int16_t mat
case item_type::FOOD: case item_type::FOOD:
return 10; return 10;
// case item_type::ROCK:
default:
return 0;
case item_type::TOOL: case item_type::TOOL:
if (size_t(item_subtype) < world->raws.itemdefs.tools.size()) if (size_t(item_subtype) < world->raws.itemdefs.tools.size())
value = world->raws.itemdefs.tools[item_subtype]->value; value = world->raws.itemdefs.tools[item_subtype]->value;
else else
value = 10; value = 10;
break; break;
case item_type::INSTRUMENT:
if (size_t(item_subtype) < world->raws.itemdefs.instruments.size())
value = world->raws.itemdefs.instruments[item_subtype]->value;
else
value = 10;
break;
// case item_type::ROCK:
default:
return 0;
} }
MaterialInfo mat; MaterialInfo mat;