From ccf1d7abbdb490672a022c0c88123ca03a7cada9 Mon Sep 17 00:00:00 2001 From: PerfectLaugh Date: Thu, 2 May 2019 00:38:02 +0900 Subject: [PATCH] Remove unneeded paramter in CS_DropWeapon (#988) Updated in 4/30/2019 csgo update --- extensions/cstrike/forwards.cpp | 6 +++--- extensions/cstrike/natives.cpp | 22 +++++++++------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/extensions/cstrike/forwards.cpp b/extensions/cstrike/forwards.cpp index 8a52d69c..faaba09e 100644 --- a/extensions/cstrike/forwards.cpp +++ b/extensions/cstrike/forwards.cpp @@ -216,12 +216,12 @@ DETOUR_DECL_MEMBER3(DetourTerminateRound, void, int, reason, int, unknown, int, #endif } -DETOUR_DECL_MEMBER3(DetourCSWeaponDrop, void, CBaseEntity *, weapon, bool, bDropShield, bool, bThrowForward) +DETOUR_DECL_MEMBER2(DetourCSWeaponDrop, void, CBaseEntity *, weapon, bool, bThrowForward) { if (g_pIgnoreCSWeaponDropDetour) { g_pIgnoreCSWeaponDropDetour = false; - DETOUR_MEMBER_CALL(DetourCSWeaponDrop)(weapon, bDropShield, bThrowForward); + DETOUR_MEMBER_CALL(DetourCSWeaponDrop)(weapon, bThrowForward); return; } @@ -236,7 +236,7 @@ DETOUR_DECL_MEMBER3(DetourCSWeaponDrop, void, CBaseEntity *, weapon, bool, bDrop if (result == Pl_Continue) { - DETOUR_MEMBER_CALL(DetourCSWeaponDrop)(weapon, bDropShield, bThrowForward); + DETOUR_MEMBER_CALL(DetourCSWeaponDrop)(weapon, bThrowForward); } return; diff --git a/extensions/cstrike/natives.cpp b/extensions/cstrike/natives.cpp index b7c862e8..b68e7731 100644 --- a/extensions/cstrike/natives.cpp +++ b/extensions/cstrike/natives.cpp @@ -227,17 +227,14 @@ static cell_t CS_DropWeapon(IPluginContext *pContext, const cell_t *params) if (!pWrapper) { REGISTER_NATIVE_ADDR(WEAPONDROP_GAMEDATA_NAME, - PassInfo pass[3]; \ + PassInfo pass[2]; \ pass[0].flags = PASSFLAG_BYVAL; \ pass[0].type = PassType_Basic; \ pass[0].size = sizeof(CBaseEntity *); \ pass[1].flags = PASSFLAG_BYVAL; \ pass[1].type = PassType_Basic; \ pass[1].size = sizeof(bool); \ - pass[2].flags = PASSFLAG_BYVAL; \ - pass[2].type = PassType_Basic; \ - pass[2].size = sizeof(bool); \ - pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 3)) + pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 2)) } CBaseEntity *pEntity; @@ -270,8 +267,7 @@ static cell_t CS_DropWeapon(IPluginContext *pContext, const cell_t *params) if (params[4] == 1 && g_pCSWeaponDropDetoured) g_pIgnoreCSWeaponDropDetour = true; - // first one is always false. second is true to toss, false to just drop - ArgBuffer vstk(pEntity, pWeapon, false, (params[3]) ? true : false); + ArgBuffer vstk(pEntity, pWeapon, (params[3]) ? true : false); pWrapper->Execute(vstk, NULL); return 1; @@ -926,9 +922,9 @@ static cell_t CS_UpdateClientModel(IPluginContext *pContext, const cell_t *param static cell_t CS_ItemDefIndexToID(IPluginContext *pContext, const cell_t *params) { #if SOURCE_ENGINE == SE_CSGO - ItemIndexMap::Result res = g_mapDefIdxToClass.find((uint16_t)params[1]); - - if (!res.found()) + ItemIndexMap::Result res = g_mapDefIdxToClass.find((uint16_t)params[1]); + + if (!res.found()) return pContext->ThrowNativeError("Invalid item definition passed."); return res->value.m_iWeaponID; @@ -940,9 +936,9 @@ static cell_t CS_ItemDefIndexToID(IPluginContext *pContext, const cell_t *params static cell_t CS_WeaponIDToItemDefIndex(IPluginContext *pContext, const cell_t *params) { #if SOURCE_ENGINE == SE_CSGO - WeaponIDMap::Result res = g_mapWeaponIDToDefIdx.find((SMCSWeapon)params[1]); - - if (!res.found()) + WeaponIDMap::Result res = g_mapWeaponIDToDefIdx.find((SMCSWeapon)params[1]); + + if (!res.found()) return pContext->ThrowNativeError("Invalid weapon id passed."); return res->value.m_iDefIdx;