From 11ead5d3b6b617250643d5ea5408a322e950b528 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Wed, 22 Nov 2023 10:19:59 +0700 Subject: [PATCH] Fixed startPercent argument type for native rg_send_bartime2 --- reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc | 4 ++-- reapi/src/natives/natives_misc.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc index edf31f99..198c3a79 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc @@ -868,7 +868,7 @@ native rg_send_bartime(const index, const duration, const bool:observer = true); * * @noreturn */ -native rg_send_bartime2(const index, const duration, const startPercent, const bool:observer = true); +native rg_send_bartime2(const index, const duration, const Float:startPercent, const bool:observer = true); /* * Sends the SendAudio message - plays the specified audio. @@ -901,7 +901,7 @@ native rg_get_iteminfo(const ent, ItemInfo:type, any:...); /** * Sets a parameter of the global CBasePlayerItem::m_ItemInfoArray array -* @note To have effect on client side (i.g. ammo size on HUD) you should +* @note To have effect on client side (i.g. ammo size on HUD) you should * alter this value BEFORE WeaponList message is sent to client, or * force it's alteration by sending again to the specific client. * Hooking WeaponList message with AMXX's register_message is a choice. diff --git a/reapi/src/natives/natives_misc.cpp b/reapi/src/natives/natives_misc.cpp index 15f85ea7..3b53665f 100644 --- a/reapi/src/natives/natives_misc.cpp +++ b/reapi/src/natives/natives_misc.cpp @@ -2014,7 +2014,7 @@ cell AMX_NATIVE_CALL rg_send_bartime(AMX *amx, cell *params) * * @noreturn * -* native rg_send_bartime2(const index, const duration, const startPercent, const bool:observer = true); +* native rg_send_bartime2(const index, const duration, const Float:startPercent, const bool:observer = true); */ cell AMX_NATIVE_CALL rg_send_bartime2(AMX *amx, cell *params) { @@ -2024,15 +2024,16 @@ cell AMX_NATIVE_CALL rg_send_bartime2(AMX *amx, cell *params) CHECK_CONNECTED(pPlayer, arg_index); CAmxArgs args(amx, params); + float startPercent = args[arg_start_percent]; if (!args[arg_observer]) { EMESSAGE_BEGIN(MSG_ONE_UNRELIABLE, gmsgBarTime2, nullptr, pPlayer->edict()); EWRITE_SHORT(args[arg_time]); - EWRITE_SHORT(args[arg_start_percent]); + EWRITE_SHORT(startPercent); EMESSAGE_END(); return TRUE; } - pPlayer->CSPlayer()->SetProgressBarTime2(args[arg_time], args[arg_start_percent]); + pPlayer->CSPlayer()->SetProgressBarTime2(args[arg_time], startPercent); return TRUE; }