From 4ec9da8cb5cf909fa20bac03dd7cade75198f7d7 Mon Sep 17 00:00:00 2001 From: Andreas Maerten <24669514+Yimura@users.noreply.github.com> Date: Sun, 28 Jul 2024 22:37:18 +0200 Subject: [PATCH] feat(carmod_shop): don't influence stats implicitly (#3462) Closes #3359 --- src/native_hooks/carmod_shop.hpp | 53 ------------------------------- src/native_hooks/native_hooks.cpp | 6 ++-- 2 files changed, 2 insertions(+), 57 deletions(-) diff --git a/src/native_hooks/carmod_shop.hpp b/src/native_hooks/carmod_shop.hpp index 80b81c59..3aa52112 100644 --- a/src/native_hooks/carmod_shop.hpp +++ b/src/native_hooks/carmod_shop.hpp @@ -6,59 +6,6 @@ namespace big { namespace carmod_shop { - inline void STAT_GET_INT(rage::scrNativeCallContext* src) - { - const auto hash = src->get_arg(0); - int* out = src->get_arg(1); - src->set_return_value(1); - - switch (hash) - { - case "MP0_RACES_WON"_J: - case "MP0_NUMBER_TURBO_STARTS_IN_RACE"_J: - case "MP0_USJS_COMPLETED"_J: - case "MP0_AWD_FM_RACES_FASTEST_LAP"_J: - case "MP1_RACES_WON"_J: - case "MP1_NUMBER_TURBO_STARTS_IN_RACE"_J: - case "MP1_USJS_COMPLETED"_J: - case "MP1_AWD_FM_RACES_FASTEST_LAP"_J: *out = 50; break; - case "MP0_NUMBER_SLIPSTREAMS_IN_RACE"_J: - case "MP1_NUMBER_SLIPSTREAMS_IN_RACE"_J: *out = 100; break; - case "MP0_CHAR_FM_CARMOD_1_UNLCK"_J: - case "MP0_CHAR_FM_CARMOD_2_UNLCK"_J: - case "MP0_CHAR_FM_CARMOD_3_UNLCK"_J: - case "MP0_CHAR_FM_CARMOD_4_UNLCK"_J: - case "MP0_CHAR_FM_CARMOD_5_UNLCK"_J: - case "MP0_CHAR_FM_CARMOD_6_UNLCK"_J: - case "MP0_CHAR_FM_CARMOD_7_UNLCK"_J: - case "MP1_CHAR_FM_CARMOD_1_UNLCK"_J: - case "MP1_CHAR_FM_CARMOD_2_UNLCK"_J: - case "MP1_CHAR_FM_CARMOD_3_UNLCK"_J: - case "MP1_CHAR_FM_CARMOD_4_UNLCK"_J: - case "MP1_CHAR_FM_CARMOD_5_UNLCK"_J: - case "MP1_CHAR_FM_CARMOD_6_UNLCK"_J: - case "MP1_CHAR_FM_CARMOD_7_UNLCK"_J: *out = -1; break; - case "MP0_AWD_FMRALLYWONDRIVE"_J: - case "MP0_AWD_FMRALLYWONNAV"_J: - case "MP0_AWD_FMWINSEARACE"_J: - case "MP0_AWD_FMWINAIRRACE"_J: - case "MP1_AWD_FMRALLYWONDRIVE"_J: - case "MP1_AWD_FMRALLYWONNAV"_J: - case "MP1_AWD_FMWINSEARACE"_J: - case "MP1_AWD_FMWINAIRRACE"_J: *out = 1; break; - default: src->set_return_value(STATS::STAT_GET_INT(hash, out, src->get_arg(2))); break; - } - } - - inline void STAT_SET_INT(rage::scrNativeCallContext* src) - { - const auto hash = src->get_arg(0); - if (hash == "SP0_TOTAL_CASH"_J || hash == "SP1_TOTAL_CASH"_J || hash == "SP2_TOTAL_CASH"_J) - return; - - src->set_return_value(STATS::STAT_SET_INT(hash, src->get_arg(1), src->get_arg(2))); - } - inline void SET_ENTITY_COORDS(rage::scrNativeCallContext* src) { if (!g.vehicle.ls_customs) diff --git a/src/native_hooks/native_hooks.cpp b/src/native_hooks/native_hooks.cpp index 9cdda683..c56b147d 100644 --- a/src/native_hooks/native_hooks.cpp +++ b/src/native_hooks/native_hooks.cpp @@ -2,13 +2,13 @@ #include "all_scripts.hpp" #include "am_launcher.hpp" +#include "am_pi_menu.hpp" #include "carmod_shop.hpp" #include "creator.hpp" #include "freemode.hpp" #include "network_session_host.hpp" #include "shop_controller.hpp" #include "tunables.hpp" -#include "am_pi_menu.hpp" #include