Small fix

This commit is contained in:
fed 2023-01-29 00:52:47 +01:00
parent ed6e71ff11
commit 4024ca483a

View File

@ -170,6 +170,11 @@ namespace weapon
void add_entries_to_enum(game::DDLEnum* enum_, const std::vector<const char*> entries) void add_entries_to_enum(game::DDLEnum* enum_, const std::vector<const char*> entries)
{ {
if (entries.size() <= 0)
{
return;
}
const auto new_size = enum_->memberCount + entries.size(); const auto new_size = enum_->memberCount + entries.size();
const auto members = ddl_allocator.allocate_array<const char*>(new_size); const auto members = ddl_allocator.allocate_array<const char*>(new_size);
const auto hash_list = ddl_allocator.allocate_array<game::DDLHash>(new_size); const auto hash_list = ddl_allocator.allocate_array<game::DDLHash>(new_size);