From c439240ecd29aa572b02644a85eb897d46093a06 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sat, 26 Jan 2019 11:05:55 +0100 Subject: [PATCH] Prepare fov module --- src/module/fov.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/module/fov.cpp diff --git a/src/module/fov.cpp b/src/module/fov.cpp new file mode 100644 index 0000000..8c3ca39 --- /dev/null +++ b/src/module/fov.cpp @@ -0,0 +1,23 @@ +#include +#include "loader/module_loader.hpp" +#include "utils/hook.hpp" +#include "game/game.hpp" + +class fov final : public module +{ +public: + void post_load() override + { + if (game::is_dedi()) return; + + utils::hook::set(SELECT_VALUE(0x4302C5, 0x455155, 0), 0x41); + + if (game::is_mp()) + { + static const auto cg_fov_limit = 90.0f; + utils::hook::set(0x455148, &cg_fov_limit); + } + } +}; + +REGISTER_MODULE(fov)