Open
Description
Early returns are missing in InGameUI::Hide_Object_Superweapon_Display_By_Script, InGameUI::Show_Object_Superweapon_Display_By_Script.
void InGameUI::Hide_Object_Superweapon_Display_By_Script(Object const *obj)
{
ObjectID id = obj->Get_ID();
for (int i = 0; i < MAX_PLAYER_COUNT; i++) {
for (auto it = m_superweapons[i].begin(); it != m_superweapons[i].end(); it++) {
for (auto it2 = it->second.begin(); it2 != it->second.end(); it2++) {
if ((*it2)->m_objectID == id) {
(*it2)->m_hidden = true;
}
}
}
}
}
void InGameUI::Show_Object_Superweapon_Display_By_Script(Object const *obj)
{
ObjectID id = obj->Get_ID();
for (int i = 0; i < MAX_PLAYER_COUNT; i++) {
for (auto it = m_superweapons[i].begin(); it != m_superweapons[i].end(); it++) {
for (auto it2 = it->second.begin(); it2 != it->second.end(); it2++) {
if ((*it2)->m_objectID == id) {
(*it2)->m_hidden = false;
}
}
}
}
}
Objects should be unique inside m_superweapons
. So once a text for an object is found and set hidden, the function should be able to return.