db_lmdb: add missing fields in get_as_{city,account,flag}

This commit is contained in:
Crypto City 2022-07-01 07:36:33 +00:00
parent 32314a1dc4
commit ec247f73e4

View File

@ -10427,6 +10427,17 @@ bool BlockchainLMDB::get_as_cc_account(const cryptonote::blobdata &bd, cc_accoun
data.script_local_variables = std::move(ad.script_local_variables);
data.script_string_overrides = std::move(ad.script_string_overrides);
data.prestige = ad.prestige;
for (auto &e: ad.background_script_states)
{
const uint32_t script = e.first;
const uint32_t state = std::get<0>(e.second);
const uint32_t city = std::get<1>(e.second);
const uint32_t owner = std::get<2>(e.second);
std::map<std::string, uint64_t> locals;
for (auto &f: std::get<3>(e.second))
locals.insert(std::make_pair(std::move(f.first), f.second));
data.background_script_states.insert(std::make_pair(script, std::make_tuple(state, city, owner, std::move(locals))));
}
return true;
}
@ -10467,12 +10478,16 @@ bool BlockchainLMDB::get_as_cc_flag(const cryptonote::blobdata &bd, cc_flag_data
cfd.sow_height = fd.sow_height;
cfd.vegetables_nutrients = fd.vegetables_nutrients;
cfd.grain_nutrients = fd.grain_nutrients;
cfd.mortgage = fd.mortgage;
cfd.num_missed_ticks = fd.num_missed_ticks;
cfd.num_fishing_ticks = fd.num_fishing_ticks;
cfd.fishing_distance = fd.fishing_distance;
cfd.fishing_city = fd.fishing_city;
cfd.fish = fd.fish;
cfd.budget = std::move(fd.budget);
clear_zero_entries(cfd.budget);
cfd.palette = std::move(fd.palette);
cfd.tiles = std::move(fd.tiles);
return true;
}
@ -10497,6 +10512,8 @@ bool BlockchainLMDB::get_as_cc_city(const cryptonote::blobdata &bd, cc_city_data
ccd.close_fish = cd.close_fish;
ccd.medium_fish = cd.medium_fish;
ccd.name = cd.name;
ccd.allow_styling = cd.allow_styling;
ccd.allow_settlers = cd.allow_settlers;
return true;
}