mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 06:55:09 +00:00
Fix idm::allocate_id at fixed position
This commit is contained in:
parent
72ed2f1d43
commit
526aaf7302
4 changed files with 26 additions and 10 deletions
|
|
@ -35,10 +35,13 @@ std::vector<std::pair<u128, id_manager::typeinfo>>& id_manager::get_typeinfo_map
|
|||
|
||||
idm::map_data* idm::allocate_id(std::vector<map_data>& vec, u32 type_id, u32 dst_id, u32 base, u32 step, u32 count, bool uses_lowest_id, std::pair<u32, u32> invl_range)
|
||||
{
|
||||
if (const u32 index = id_manager::get_index(dst_id, base, step, count, invl_range); index < count)
|
||||
if (dst_id != (base ? 0 : u32{umax}))
|
||||
{
|
||||
// Fixed position construction
|
||||
ensure(index < vec.size());
|
||||
const u32 index = id_manager::get_index(dst_id, base, step, count, invl_range);
|
||||
ensure(index < count);
|
||||
|
||||
vec.resize(std::max<usz>(vec.size(), index + 1));
|
||||
|
||||
if (vec[index].second)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue