Skip to content

Commit

Permalink
Fixed startPercent argument type for native rg_send_bartime2
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Nov 22, 2023
1 parent 1a72c8a commit 11ead5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions reapi/src/natives/natives_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
}

Expand Down

0 comments on commit 11ead5d

Please sign in to comment.