|
|
|
@ -21,7 +21,7 @@ namespace DFHack {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
void OrganicMatLookup::food_mat_by_idx(organic_mat_category::organic_mat_category mat_category, std::vector<int16_t>::size_type food_idx, FoodMat& food_mat) {
|
|
|
|
|
DEBUG(log).print("food_lookup: food_idx(%zd) ", food_idx);
|
|
|
|
|
DEBUG(log).print("food_lookup: food_idx(%zd)\n", food_idx);
|
|
|
|
|
df::world_raws& raws = world->raws;
|
|
|
|
|
df::special_mat_table table = raws.mat_table;
|
|
|
|
|
int32_t main_idx = table.organic_indexes[mat_category][food_idx];
|
|
|
|
@ -31,11 +31,11 @@ void OrganicMatLookup::food_mat_by_idx(organic_mat_category::organic_mat_categor
|
|
|
|
|
mat_category == organic_mat_category::Eggs) {
|
|
|
|
|
food_mat.creature = raws.creatures.all[type];
|
|
|
|
|
food_mat.caste = food_mat.creature->caste[main_idx];
|
|
|
|
|
DEBUG(log).print("special creature type(%d) caste(%d)", type, main_idx);
|
|
|
|
|
DEBUG(log).print("special creature type(%d) caste(%d)\n", type, main_idx);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
food_mat.material.decode(type, main_idx);
|
|
|
|
|
DEBUG(log).print("type(%d) index(%d) token(%s)", type, main_idx, food_mat.material.getToken().c_str());
|
|
|
|
|
DEBUG(log).print("type(%d) index(%d) token(%s)\n", type, main_idx, food_mat.material.getToken().c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
std::string OrganicMatLookup::food_token_by_idx(organic_mat_category::organic_mat_category mat_category, std::vector<int16_t>::size_type idx) {
|
|
|
|
@ -74,7 +74,7 @@ void OrganicMatLookup::food_build_map() {
|
|
|
|
|
int16_t OrganicMatLookup::food_idx_by_token(organic_mat_category::organic_mat_category mat_category, const std::string& token) {
|
|
|
|
|
df::world_raws& raws = world->raws;
|
|
|
|
|
df::special_mat_table table = raws.mat_table;
|
|
|
|
|
DEBUG(log).print("food_idx_by_token: ");
|
|
|
|
|
DEBUG(log).print("food_idx_by_token:\n");
|
|
|
|
|
if (mat_category == organic_mat_category::Fish ||
|
|
|
|
|
mat_category == organic_mat_category::UnpreparedFish ||
|
|
|
|
|
mat_category == organic_mat_category::Eggs) {
|
|
|
|
|