From 9a199c8efa8074e31cef88d02e256ced4f9fb839 Mon Sep 17 00:00:00 2001 From: zaCade Date: Thu, 25 Apr 2019 18:04:17 +0200 Subject: [PATCH] Revert "entWatch4: Drop Ammo aswell, when force drops happen." This reverts commit b09777159a4fc30a174646f306fee05323587c46. --- _entWatch4/scripting/entWatch-core.sp | 4 ++-- _entWatch4/scripting/entWatch-tools.sp | 2 +- .../scripting/include/entWatch_helpers.inc | 24 ------------------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/_entWatch4/scripting/entWatch-core.sp b/_entWatch4/scripting/entWatch-core.sp index 0901cbb3..a65202e8 100644 --- a/_entWatch4/scripting/entWatch-core.sp +++ b/_entWatch4/scripting/entWatch-core.sp @@ -420,7 +420,7 @@ public void OnClientDisconnect(int client) { if (item.bWeapon && !(item.dConfig.iSlot == SLOT_NONE || item.dConfig.iSlot == SLOT_KNIFE)) { - Client_DropWeapon(item.iClient, item.iWeapon); + SDKHooks_DropWeapon(item.iClient, item.iWeapon, NULL_VECTOR, NULL_VECTOR); } item.iClient = INVALID_ENT_REFERENCE; @@ -451,7 +451,7 @@ public void OnClientDeath(Event hEvent, const char[] sEvent, bool bDontBroadcast { if (item.bWeapon && !(item.dConfig.iSlot == SLOT_NONE || item.dConfig.iSlot == SLOT_KNIFE)) { - Client_DropWeapon(item.iClient, item.iWeapon); + SDKHooks_DropWeapon(item.iClient, item.iWeapon, NULL_VECTOR, NULL_VECTOR); } item.iClient = INVALID_ENT_REFERENCE; diff --git a/_entWatch4/scripting/entWatch-tools.sp b/_entWatch4/scripting/entWatch-tools.sp index efcb4456..a5b81965 100644 --- a/_entWatch4/scripting/entWatch-tools.sp +++ b/_entWatch4/scripting/entWatch-tools.sp @@ -76,7 +76,7 @@ public Action Command_TransferItem(int client, int args) { if (item.bWeapon && !(item.dConfig.iSlot == SLOT_NONE || item.dConfig.iSlot == SLOT_KNIFE)) { - Client_DropWeapon(item.iClient, item.iWeapon); + SDKHooks_DropWeapon(item.iClient, item.iWeapon, NULL_VECTOR, NULL_VECTOR); char sWeaponClass[32]; GetEntityClassname(item.iWeapon, sWeaponClass, sizeof(sWeaponClass)); diff --git a/_entWatch4/scripting/include/entWatch_helpers.inc b/_entWatch4/scripting/include/entWatch_helpers.inc index 2a62b364..504ff33a 100644 --- a/_entWatch4/scripting/include/entWatch_helpers.inc +++ b/_entWatch4/scripting/include/entWatch_helpers.inc @@ -69,30 +69,6 @@ stock int Client_GetObserverTarget(int client) return GetEntPropEnt(client, Prop_Send, "m_hObserverTarget"); } -/** - * Drops a client's weapon. - * - * @param client Client Index. - * @param weapon Weapon Index. - * @noreturn - */ -stock void Client_DropWeapon(int client, int weapon) -{ - int iPrimaryAmmoType = GetEntProp(weapon, Prop_Data, "m_iPrimaryAmmoType"); - int iSecondaryAmmoType = GetEntProp(weapon, Prop_Data, "m_iSecondaryAmmoType"); - - int iAmmoPrimary = GetEntProp(client, Prop_Send, "m_iAmmo", _, iPrimaryAmmoType); - int iAmmoSecondary = GetEntProp(client, Prop_Send, "m_iAmmo", _, iSecondaryAmmoType); - - SetEntProp(client, Prop_Send, "m_iAmmo", 0, _, iPrimaryAmmoType); - SetEntProp(client, Prop_Send, "m_iAmmo", 0, _, iSecondaryAmmoType); - - SDKHooks_DropWeapon(client, weapon, NULL_VECTOR, NULL_VECTOR); - - SetEntProp(weapon, Prop_Data, "m_iPrimaryAmmoCount", iAmmoPrimary); - SetEntProp(weapon, Prop_Data, "m_iSecondaryAmmoCount", iAmmoSecondary); -} - /* * Checks if an entity is valid and exists. *