diff --git a/src/aim1_mod_maker/aim1_mod_maker.h b/src/aim1_mod_maker/aim1_mod_maker.h index 4f78b5b..f386c83 100644 --- a/src/aim1_mod_maker/aim1_mod_maker.h +++ b/src/aim1_mod_maker/aim1_mod_maker.h @@ -543,6 +543,9 @@ struct mod_maker { throw std::runtime_error{"no such mechmind or group: " + name}; } auto new_n = 1 + sizeof...(cfgs); + if (new_n > 10) { + throw std::runtime_error{"aim1 allows only 10 mechminds in a group max"}; + } primitives::templates2::mmap_file f{fn, primitives::templates2::mmap_file::rw{}}; auto &n = *(uint32_t*)(f.p + it->second.n_mechs_offset); auto oldn = n; @@ -557,6 +560,9 @@ struct mod_maker { if (cfg.size() > 0x20-1) { throw std::runtime_error{"too long config name: " + cfg}; } + if (!db()["Конфигурации"].contains(cfg)) { + throw std::runtime_error{"there is no such configuration in the database: " + cfg}; + } strcpy(p, cfg.data()); p += 0x20; };