WopsS / RED4ext.SDK

A library to create mods for REDengine 4 (Cyberpunk 2077), independently of RED4ext.
MIT License
100 stars 33 forks source link

Fixed HashMap + more TransactionSystem #84

Closed psiberx closed 1 year ago

psiberx commented 1 year ago

Found that HashMap deletions are broken. I was lucky to find an implementation in TransactionSystem and adjusted ours accourdigly. Sombra's implementation was pretty accurate except one tiny mistake:

while (idx != INVALID_INDEX)
{
    Node* prevNode = nullptr; // should've been outside of loop :)
    Node* node = &nodes[idx];
    ...
    prevNode = node;
    idx = node->next;
}

For reference their implementation can be found here: 83 7D ? ? 74 ? 33 D2 8B C3 F7 75 ? 48 8B 45 ? 8B 0C 90 48 8D 14 90 83 F9 ? 74 ? 44 8B 45 ? 4C 8B 4D

HashMap3