diff --git a/examples/mods/aim1_community_fix/my_mod.cpp b/examples/mods/aim1_community_fix/my_mod.cpp index 9528221..e20efd1 100644 --- a/examples/mods/aim1_community_fix/my_mod.cpp +++ b/examples/mods/aim1_community_fix/my_mod.cpp @@ -263,7 +263,16 @@ int main(int argc, char *argv[]) { after = mod.add_map_good("location1.mmo", "B_L1_BASE1", after, mmo_storage2::map_good(n)); } // does not work, crashes. Maybe different item size + // or maybe too many goods /*for (auto after = "EQP_POLYMER_ARMOR_S1"s; auto &&[n, _] : db["Оборудование"]) { + if (!(false + || n.contains("_DRIVE_") + || n.contains("_REACTOR_") + || n.contains("_ARMOR_") + || n.contains("_SHIELD_G") + )) { + continue; + } after = mod.add_map_good("location1.mmo", "B_L1_BASE1", after, mmo_storage2::map_good(n)); }*/ // patch note dev: start money, rating, glider and sector access diff --git a/src/aim1_mod_maker/aim1_mod_maker.h b/src/aim1_mod_maker/aim1_mod_maker.h index 2bd504c..ba1791e 100644 --- a/src/aim1_mod_maker/aim1_mod_maker.h +++ b/src/aim1_mod_maker/aim1_mod_maker.h @@ -332,7 +332,13 @@ struct mod_maker { ::memcpy(f.p + offset, data.data(), data.size()); f.close(); } - std::string add_map_good(path mmo_fn, const std::string &building_name, const std::string &after_good_name, const mmo_storage2::map_good &mg) { + std::string add_map_good(path mmo_fn, const std::string &building_name, const std::string &after_good_name, + const mmo_storage2::map_good &mg) { + log("adding map good to {} after {}: ", building_name, after_good_name, std::string{mg.name}); + if (!std::string{mg.cond}.empty()) { + log("cond: {}", std::string{mg.cond}); + } + byte_array data((uint8_t*)&mg, (uint8_t*)&mg + sizeof(mg)); add_map_good(mmo_fn, building_name, after_good_name, data); return mg.name;