Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge #1

Merged
merged 45 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
fe6150a
Implemented native REU_GetAuthKey
s1lentq Jan 30, 2022
2bda2c3
Update workflows/build.yml Set windows job container as windows-2019 …
s1lentq Feb 26, 2022
4e23c65
Implement `RH_*_Precache_*`, `RH_SV_AddResource`, `RH_SV_ClientPrintf…
ShadowsAdi Sep 19, 2022
7d9bd65
Fixed typo into hook CBasePlayer::SwitchTeam
s1lentq Nov 18, 2022
aeabd1f
Implement RH_SV_AllowPhysent hook (#265)
Feb 11, 2023
ab94d09
Add ITEM_FLAG_NOFIREUNDERWATER to cssdk_const.inc (#267)
fl0werD Mar 2, 2023
867368f
Improved description for `rg_get_weapon_info` (#269)
Nord1cWarr1or Mar 17, 2023
d2347e8
`API`: Implement `RH_ExecuteServerStringCmd` hook (#263)
ShadowsAdi Mar 31, 2023
b85d4ae
Improve include descriptions `rg_fire_bullets`, `rg_fire_buckshots` a…
RauliTop Mar 31, 2023
ac3d641
`rg_give_defusekit()`: Add player team check (#234)
Giferns Mar 31, 2023
7be36cc
Implement `rh_get_client_connect_time()` native (#259)
FEDERICOMB96 Mar 31, 2023
60f3230
Fix ``TimeBasedDamage enum`` typo at cssdk_const.inc (#256)
RauliTop Mar 31, 2023
5c5478c
SetHookChainArg: handle `default` case.
SergeyShorokhov Jul 1, 2023
8c670fa
GetBonePosition/GetAttachment: Added index bounds check
s1lentq Jul 3, 2023
7c959fa
Implemented ATYPE_TRACE for SetHookChainArg native useful for replace…
s1lentq Jul 14, 2023
1b4ee4e
Add new trace flags to cssdk_const.inc (#278)
Jul 15, 2023
e478314
Add m_flEjectBrass description (#274)
RauliTop Jul 15, 2023
3cbdc16
Implement RG_CreateWeaponBox hook (#275)
dystopm Jul 15, 2023
d9b72bf
`API`: Implement `RG_PM_LadderMove` hook (#254)
ShadowsAdi Jul 15, 2023
87e4858
Update SDK
s1lentq Jul 15, 2023
4155dd4
`API`: CSPlayer and CKnife additions + headers refactory (#277)
dystopm Jul 15, 2023
28fe32e
Update CSSDK
s1lentq Aug 24, 2023
a60e2b5
Disable fixes angles for natives GetBonePosition/GetAttachment if ReG…
s1lentq Aug 26, 2023
2bceff9
Reworked entity callback dispatcher
s1lentq Sep 3, 2023
30c1964
Add an important clarification to the native rg_create_entity comment…
s1lentq Sep 3, 2023
20d8133
Update cmake/project files
s1lentq Sep 3, 2023
2b8ae61
Fix comment
s1lentq Sep 3, 2023
eab1658
Fix SetMoveDone callback dispatcher
s1lentq Sep 3, 2023
da81fe5
Update workflows/build.yml
s1lentq Sep 5, 2023
4637997
`API`: Added rg_set/get_global_iteminfo natives (#279)
dystopm Sep 5, 2023
4ef1955
Added a new argument removeAmmo to the rg_remove_items_by_slot native…
Javekson Sep 5, 2023
2142208
`API`: New gamedll hookchains (#280)
dystopm Sep 5, 2023
fcca39b
Fix error 029: invalid expression for IsRoundExpireEvent (#286)
Javekson Sep 25, 2023
2077022
Refactored rg_remove_items_by_slot and updated the return logic (#288)
Javekson Oct 7, 2023
e36a40c
Updated the return logic of rg_drop_item and rg_drop_items_by_slot (#…
Javekson Oct 7, 2023
08210be
Info_SetValueForStarKey allow a colon in playername
s1lentq Oct 7, 2023
ed57d7b
SV_CheckUserInfo: Refer to 'userinfo' argument as a pointer instead o…
s1lentq Oct 7, 2023
1a72c8a
Improved initialization of rehlds api
s1lentq Oct 9, 2023
11ead5d
Fixed startPercent argument type for native rg_send_bartime2
s1lentq Nov 22, 2023
cf757aa
Added GetBodygroup, SetBodygroup, GetSequenceInfo natives (#294)
dystopm Nov 26, 2023
b281588
fix(rg_transfer_c4): prevent C4 destruction on arg receiver = 0 (#291)
Javekson Nov 26, 2023
4c1932c
Headers update, rename m_bHasSecondaryAttack, CSPlayer member additio…
dystopm Nov 26, 2023
5c38e6f
Implemented CCSEntity members to export in AMXX headers (#296)
dystopm Nov 26, 2023
bf8b9bd
Fix GiveC4 hook callback return type (#295)
dystopm Nov 26, 2023
4430205
API upgrade: 15 new natives (#297)
dystopm Nov 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(rg_transfer_c4): prevent C4 destruction on arg receiver = 0 (rehl…
  • Loading branch information
Javekson authored Nov 26, 2023
commit b281588ddf8f68bba67498f9dc8a6cca1f7a44fb
2 changes: 1 addition & 1 deletion reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ native rg_get_user_footsteps(const index);
* @param index Client index
* @param receiver Receiver index, if 0 it will transfer to a random player
*
* @return 1 on success, 0 otherwise
* @return Index of player entity if successfull, 0 otherwise
*/
native rg_transfer_c4(const index, const receiver = 0);

Expand Down
2 changes: 1 addition & 1 deletion reapi/include/cssdk/dlls/gamerules.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ class CHalfLifeMultiplay: public CGameRules
// check if the scenario has been won/lost
virtual void CheckWinConditions() = 0;
virtual void RemoveGuns() = 0;
virtual void GiveC4() = 0;
virtual CBasePlayer *GiveC4() = 0;
virtual void ChangeLevel() = 0;
virtual void GoToIntermission() = 0;

Expand Down
46 changes: 34 additions & 12 deletions reapi/src/natives/natives_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1575,10 +1575,11 @@ cell AMX_NATIVE_CALL rg_get_user_footsteps(AMX *amx, cell *params)
* @param index Client index
* @param receiver Receiver index, if 0 it will transfer to a random player
*
* @return 1 on success, 0 otherwise
* @return Index of player entity if successfull, 0 otherwise
*
* native rg_transfer_c4(const index, const receiver = 0);
*/

cell AMX_NATIVE_CALL rg_transfer_c4(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_index, arg_receiver };
Expand All @@ -1589,29 +1590,50 @@ cell AMX_NATIVE_CALL rg_transfer_c4(AMX *amx, cell *params)
CBasePlayer *pPlayer = UTIL_PlayerByIndex(params[arg_index]);
CHECK_CONNECTED(pPlayer, arg_index);

if (!pPlayer->m_bHasC4 || !pPlayer->CSPlayer()->RemovePlayerItem("weapon_c4"))
if (!pPlayer->m_bHasC4) {
return FALSE;
}

pPlayer->pev->body = 0;
pPlayer->m_bHasC4 = false;
pPlayer->CSPlayer()->SetBombIcon();
pPlayer->CSPlayer()->SetProgressBarTime(0);
CBasePlayer *pReceiver = nullptr;

if (params[arg_receiver] != 0 && params[arg_receiver] <= gpGlobals->maxClients) {
CBasePlayer *pReceiver = UTIL_PlayerByIndex(params[arg_receiver]);
if (params[arg_receiver] > 0 && params[arg_receiver] <= gpGlobals->maxClients) {
pReceiver = UTIL_PlayerByIndex(params[arg_receiver]);
CHECK_CONNECTED(pReceiver, arg_receiver);

if (!pReceiver->CSPlayer()->MakeBomber())
if (!pPlayer->CSPlayer()->RemovePlayerItemEx("weapon_c4", true)) {
return FALSE;
}

if (!pReceiver->CSPlayer()->MakeBomber()) {
return FALSE;
}
}
else {
int NumDeadCT, NumDeadTerrorist, NumAliveTerrorist, NumAliveCT;
CSGameRules()->InitializePlayerCounts(NumAliveTerrorist, NumAliveCT, NumDeadTerrorist, NumDeadCT);

if (pPlayer->m_iTeam == CT && NumAliveTerrorist < 1) {
return FALSE;
}

if (pPlayer->m_iTeam == TERRORIST && NumAliveTerrorist < 2) {
return FALSE;
}

if (!pPlayer->CSPlayer()->RemovePlayerItemEx("weapon_c4", true)) {
return FALSE;
}

} else {
auto flags = pPlayer->pev->flags;
pPlayer->pev->flags |= FL_DORMANT;
CSGameRules()->GiveC4();
pReceiver = CSGameRules()->GiveC4();
pPlayer->pev->flags = flags;
}

return TRUE;
if (pReceiver)
return indexOfPDataAmx(pReceiver);

return FALSE;
}

/*
Expand Down