From 89d055a559ee0c2451d7a045343fd2c7e3721d23 Mon Sep 17 00:00:00 2001 From: Maurice Heumann Date: Sun, 5 Feb 2023 10:16:33 +0100 Subject: [PATCH] Skip the intro for dev builds #128 --- src/client/component/intro.cpp | 37 ++++++++++++++++++++++++++++++++++ src/client/game/symbols.hpp | 1 + 2 files changed, 38 insertions(+) create mode 100644 src/client/component/intro.cpp diff --git a/src/client/component/intro.cpp b/src/client/component/intro.cpp new file mode 100644 index 00000000..f207699d --- /dev/null +++ b/src/client/component/intro.cpp @@ -0,0 +1,37 @@ +#include +#include "loader/component_loader.hpp" +#include "game/game.hpp" + +#include + +namespace intro +{ + namespace + { + utils::hook::detour cinematic_start_playback_hook; + + void ccc(const char* name, const char* key, const unsigned int playback_flags, const float volume, + void* callback_info, const int id) + { + if (name == "BO3_Global_Logo_LogoSequence"s) + { + return; + } + + cinematic_start_playback_hook.invoke(name, key, playback_flags, volume, callback_info, id); + } + } + + class component final : public client_component + { + public: + void post_unpack() override + { + cinematic_start_playback_hook.create(game::Cinematic_StartPlayback, ccc); + } + }; +} + +#ifdef DEV_BUILD +REGISTER_COMPONENT(intro::component) +#endif diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 8b2f7cc9..7ce4b347 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -92,6 +92,7 @@ namespace game }; WEAK symbol Scr_GetNumParam{0x0, 0x140171320}; + WEAK symbol Cinematic_StartPlayback{0x1412BE3A0}; WEAK symbol Cinematic_StopPlayback{0x1412BEA70}; WEAK symbol ShouldTransfer{0x142276E10};