GetVariable to 100

This commit is contained in:
disinvite 2023-07-08 23:35:54 -04:00
parent e33b3c778b
commit 85e45f67d3
2 changed files with 6 additions and 6 deletions

View File

@ -40,7 +40,7 @@ void MxVariableTable::SetVariable(MxVariable *var)
// OFFSET: LEGO1 0x100b78f0 // OFFSET: LEGO1 0x100b78f0
const char *MxVariableTable::GetVariable(const char *p_key) const char *MxVariableTable::GetVariable(const char *p_key)
{ {
const char *value = NULL; const char *value = "";
MxHashTableCursor<MxVariable> cursor(this); MxHashTableCursor<MxVariable> cursor(this);
MxVariable *var = new MxVariable(p_key); MxVariable *var = new MxVariable(p_key);

View File

@ -32,7 +32,7 @@ class MxHashTable : public MxCore
MxHashTable() MxHashTable()
{ {
m_size = 128; m_size = 128;
m_table = new MxHashTableNode<T>[128]; m_table = new MxHashTableNode<T>*[128];
} }
~MxHashTable() ~MxHashTable()
@ -46,7 +46,7 @@ class MxHashTable : public MxCore
//private: //private:
int m_used; // +0x8 int m_used; // +0x8
void (*m_unkc)(void *); // +0xc void (*m_unkc)(void *); // +0xc
MxHashTableNode<T> *m_table; // +0x10 MxHashTableNode<T> **m_table; // +0x10
int m_size; // +0x14 int m_size; // +0x14
int m_unk18; int m_unk18;
int m_unk1c; int m_unk1c;
@ -67,12 +67,12 @@ class MxHashTableCursor : public MxCore
MxBool Find(T *p_obj) MxBool Find(T *p_obj)
{ {
MxU32 hash = m_hashTable->Hash(p_obj); MxU32 hash = m_hashTable->Hash(p_obj);
int bucket = hash / m_hashTable->m_size; int bucket = hash % m_hashTable->m_size;
MxHashTableNode<T> *t = &m_hashTable->m_table[bucket]; MxHashTableNode<T> *t = m_hashTable->m_table[bucket];
while (t) { while (t) {
if (t->m_hash == hash && !m_hashTable->Compare(p_obj, t->m_obj)) if (t->m_hash == hash && !m_hashTable->Compare(t->m_obj, p_obj))
m_match = t; m_match = t;
t = t->m_next; t = t->m_next;
} }