Skip the intro for dev builds

#128
This commit is contained in:
Maurice Heumann 2023-02-05 10:16:33 +01:00
parent 74bb7bcf0b
commit 89d055a559
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,37 @@
#include <std_include.hpp>
#include "loader/component_loader.hpp"
#include "game/game.hpp"
#include <utils/hook.hpp>
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

View File

@ -92,6 +92,7 @@ namespace game
};
WEAK symbol<unsigned int(scriptInstance_t inst)> Scr_GetNumParam{0x0, 0x140171320};
WEAK symbol<void(const char* name, const char* key, unsigned int playbackFlags, float volume, void* callbackInfo, int id)> Cinematic_StartPlayback{0x1412BE3A0};
WEAK symbol<void(uint64_t id, bool cancelAll)> Cinematic_StopPlayback{0x1412BEA70};
WEAK symbol<bool(void* storageFileInfo)> ShouldTransfer{0x142276E10};