Fix missing event count increment during mod loading

This commit is contained in:
Mr-Wiseguy 2024-12-31 13:17:15 -05:00
parent c6da24b913
commit 6fea51cba6

View file

@ -1008,6 +1008,9 @@ recomp::mods::CodeModLoadError recomp::mods::ModContext::load_mod_code(uint8_t*
.reference_section_addresses = section_addresses, .reference_section_addresses = section_addresses,
}; };
// Allocate the event indices used by the mod.
num_events += mod.num_events();
// Copy the mod's binary into the recompiler context so it can be analyzed during code loading. // Copy the mod's binary into the recompiler context so it can be analyzed during code loading.
// TODO move it instead, right now the move can't be done because of a signedness difference in the types. // TODO move it instead, right now the move can't be done because of a signedness difference in the types.
mod.recompiler_context->rom.assign(binary_span.begin(), binary_span.end()); mod.recompiler_context->rom.assign(binary_span.begin(), binary_span.end());