TheAssemblyArmada / Thyme

An open source re-implementation of Generals : Zero Hour written in C++.
GNU General Public License v2.0
585 stars 59 forks source link

SidesList::Prepare_For_MP_Or_Skirmish has minor duplicate code #1029

Open xezon opened 11 months ago

xezon commented 11 months ago
SidesList::Prepare_For_MP_Or_Skirmish()
{
...
                if (player_index != -1) {
                    ScriptList *list = Get_Skirmish_Side_Info(player_index)->Get_Script_List();
                    Get_Skirmish_Side_Info(player_index)->Set_Script_List(scripts[j]);
                    scripts[j] = nullptr;

                    if (list != nullptr) {
                        list->Delete_Instance();
                    }

                    scripts[j] = nullptr;
                }
...
}

Sets scripts[j] = nullptr; twice.