Skip to content

Commit

Permalink
Update CustomMixes.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Belonit committed Jan 21, 2024
1 parent 3299599 commit 58e2d97
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Spawner/CustomMixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
* You should have received a copy of the GNU General Public License
* along with this program.If not, see <http://www.gnu.org/licenses/>.
*/

#include "Ra2Mode.h"

#include <Utilities/Macro.h>
#include <MixFileClass.h>

MixFileClass *Ra2ModeMIX = nullptr;
MixFileClass* Ra2ModeMIX = nullptr;
MixFileClass* CnCnetMIX = nullptr;

DEFINE_HOOK(0x6BE9BD, ProgEnd_CustomMixes, 0x6)
{
Expand All @@ -31,17 +33,23 @@ DEFINE_HOOK(0x6BE9BD, ProgEnd_CustomMixes, 0x6)
Ra2ModeMIX = nullptr;
}

if (CnCnetMIX)
{
GameDelete(CnCnetMIX);
CnCnetMIX = nullptr;
}

return 0;
}

DEFINE_HOOK(0x5301AC, InitBootstrapMixfiles_CustomMixes, 0x5)
DEFINE_HOOK(0x6BD7DC, InitBootstrapMixfiles_CustomMixes, 0x5)
{
ProgEnd_CustomMixes(R);

if (Ra2Mode::IsEnabled())
{
Ra2ModeMIX = GameCreate<MixFileClass>("ra2mode.mix");
}

CnCnetMIX = GameCreate<MixFileClass>("cncnet.mix");

return 0;
}

0 comments on commit 58e2d97

Please sign in to comment.