From c4c554b4203ec0568092e10dff9a22d392c6b23e Mon Sep 17 00:00:00 2001 From: Drifter Date: Tue, 28 Jun 2011 20:16:05 -0400 Subject: [PATCH] Added some small fixes for new CStrike patch (2ddc75e24c53) (bug 4732, r=psychonic). --- extensions/cstrike/forwards.cpp | 6 ++--- extensions/cstrike/msvc8/cstrike.vcproj | 36 +++++++++++++++++++++++++ plugins/include/cstrike.inc | 2 ++ 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/extensions/cstrike/forwards.cpp b/extensions/cstrike/forwards.cpp index 21597669..81183064 100644 --- a/extensions/cstrike/forwards.cpp +++ b/extensions/cstrike/forwards.cpp @@ -22,7 +22,7 @@ int weaponNameOffset = -1; DETOUR_DECL_MEMBER1(DetourHandleBuy, int, const char *, weapon) { - int client = engine->IndexOfEdict(engine->PEntityOfEntIndex(gamehelpers->EntityToBCompatRef(reinterpret_cast(this)))); + int client = gamehelpers->EntityToBCompatRef(reinterpret_cast(this)); lastclient = client; @@ -100,8 +100,8 @@ DETOUR_DECL_MEMBER3(DetourCSWeaponDrop, void, CBaseEntity *, weapon, bool, somet return; } - int client = engine->IndexOfEdict(engine->PEntityOfEntIndex(gamehelpers->EntityToBCompatRef(reinterpret_cast(this)))); - int weaponIndex = engine->IndexOfEdict(engine->PEntityOfEntIndex(gamehelpers->EntityToBCompatRef(weapon))); + int client = gamehelpers->EntityToBCompatRef(reinterpret_cast(this)); + int weaponIndex = gamehelpers->EntityToBCompatRef(weapon); cell_t result = Pl_Continue; g_pCSWeaponDropForward->PushCell(client); diff --git a/extensions/cstrike/msvc8/cstrike.vcproj b/extensions/cstrike/msvc8/cstrike.vcproj index 87a73261..a852087f 100644 --- a/extensions/cstrike/msvc8/cstrike.vcproj +++ b/extensions/cstrike/msvc8/cstrike.vcproj @@ -517,6 +517,10 @@ RelativePath="..\extension.cpp" > + + @@ -539,6 +543,10 @@ RelativePath="..\extension.h" > + + @@ -575,6 +583,34 @@ > + + + + + + + + + + + + + + diff --git a/plugins/include/cstrike.inc b/plugins/include/cstrike.inc index 298d1615..f1dceaf8 100644 --- a/plugins/include/cstrike.inc +++ b/plugins/include/cstrike.inc @@ -95,6 +95,8 @@ forward Action:CS_OnCSWeaponDrop(client, weaponIndex); * @param client Client index * @param weapon Weapon classname * @param price Buffer param for the price of the weapon + * + * @note Not all "weapons" call GetWeaponPrice. Example: c4, knife, vest, vest helmet, night vision. */ forward Action:CS_OnGetWeaponPrice(client, const String:weapon[], &price);