Fixed CS_GetWeaponPrice for some weapon (bug 4994, r=psychonic).
This commit is contained in:
@@ -44,6 +44,13 @@
|
||||
|
||||
int CallPriceForward(int client, const char *weapon_name, int price);
|
||||
|
||||
#define WEAPON_C4 6
|
||||
#define WEAPON_KNIFE 28
|
||||
#define WEAPON_SHIELD 30
|
||||
#define WEAPON_KEVLAR 31
|
||||
#define WEAPON_ASSAULTSUIT 32
|
||||
#define WEAPON_NIGHTVISION 33
|
||||
|
||||
/**
|
||||
* @brief Sample implementation of the SDK Extension.
|
||||
* Note: Uncomment one of the pre-defined virtual functions in order to use it.
|
||||
|
||||
@@ -327,6 +327,16 @@ static cell_t CS_GetTranslatedWeaponAlias(IPluginContext *pContext, const cell_t
|
||||
}
|
||||
static cell_t CS_GetWeaponPrice(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
//Hard code return values for weapons that dont call GetWeaponPrice and always use default value.
|
||||
if (params[2] == WEAPON_C4 || params[2] == WEAPON_KNIFE || params[2] == WEAPON_SHIELD)
|
||||
return 0;
|
||||
if (params[2] == WEAPON_KEVLAR)
|
||||
return 650;
|
||||
if (params[2] == WEAPON_ASSAULTSUIT)
|
||||
return 1000;
|
||||
if (params[2] == WEAPON_NIGHTVISION)
|
||||
return 1250;
|
||||
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
static int priceOffset = -1;
|
||||
if (!pWrapper)
|
||||
|
||||
Reference in New Issue
Block a user