From c559a84dfd230ceb2ddb823bc454347397f329bd Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 4 Feb 2022 18:40:21 +0100 Subject: [PATCH] fix(TriggerScriptEvent): Function definition was incorrect --- BigBaseV2/src/function_types.hpp | 2 +- BigBaseV2/src/gui/window/dbg/debug_script_events.cpp | 8 ++++---- BigBaseV2/src/util/toxic.hpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BigBaseV2/src/function_types.hpp b/BigBaseV2/src/function_types.hpp index a4c98844..61db9b63 100644 --- a/BigBaseV2/src/function_types.hpp +++ b/BigBaseV2/src/function_types.hpp @@ -13,7 +13,7 @@ namespace big::functions using get_net_game_player = CNetGamePlayer*(Player player); - using trigger_script_event = void(int event_group, int* args, int arg_count, int player_bits); + using trigger_script_event = void(int event_group, int64_t* args, int arg_count, int player_bits); using increment_stat_event = bool(uint64_t net_event_struct, int64_t sender, int64_t a3); diff --git a/BigBaseV2/src/gui/window/dbg/debug_script_events.cpp b/BigBaseV2/src/gui/window/dbg/debug_script_events.cpp index c94a0137..50ffd279 100644 --- a/BigBaseV2/src/gui/window/dbg/debug_script_events.cpp +++ b/BigBaseV2/src/gui/window/dbg/debug_script_events.cpp @@ -9,7 +9,7 @@ namespace big { if (ImGui::BeginTabItem("Script Events")) { - static int* args; + static int64_t* args; static int event_arg_count = 1; static int previous_arg_count; static int event_player_bits; @@ -24,8 +24,8 @@ namespace big if (event_arg_count != previous_arg_count) { - int* temp_args = new int[event_arg_count] {0}; - memcpy(temp_args, args, sizeof(int) * std::min(event_arg_count, previous_arg_count)); + int64_t* temp_args = new int64_t[event_arg_count] {0}; + memcpy(temp_args, args, sizeof(int64_t) * std::min(event_arg_count, previous_arg_count)); delete[] args; args = temp_args; @@ -42,7 +42,7 @@ namespace big char input_arg_name[20]; sprintf(input_arg_name, "###input_dynamic_arg_%d", i); - ImGui::InputInt(input_arg_name, &args[i]); + ImGui::InputScalar(input_arg_name, ImGuiDataType_S64, &args[i]); } ImGui::Separator(); diff --git a/BigBaseV2/src/util/toxic.hpp b/BigBaseV2/src/util/toxic.hpp index 59a25277..d416ca4d 100644 --- a/BigBaseV2/src/util/toxic.hpp +++ b/BigBaseV2/src/util/toxic.hpp @@ -30,7 +30,7 @@ namespace big::toxic inline void bounty_player(Player target, int amount) { const size_t arg_count = 22; - int args[arg_count] = { + int64_t args[arg_count] = { (int)eRemoteEvent::Bounty, 0, // doesn't matter of we set this to something else, the TRIGGER_SCRIPT_EVENT routine will set it to our player id anyways target,