Fix a bcompat issue with cs_s/get_user_backpackammo() by not relying on m_rgpPlayerItems to get ammo index

This commit is contained in:
Arkshine
2016-02-25 22:17:25 +01:00
parent 62a7fe0be5
commit da2abb9c3b
4 changed files with 82 additions and 62 deletions

View File

@ -15,7 +15,7 @@
#include "CstrikeHacks.h"
CsItemInfo ItemsManager;
char WeaponNameList[MAX_WEAPONS][64];
ItemInfo WeaponsList[MAX_WEAPONS];
#define PSTATE_ALIASES_TYPE 0
#define PSTATE_ALIASES_ALIAS 1
@ -202,7 +202,7 @@ bool CsItemInfo::GetAliasInfosFromName(const char *name, AliasInfo *info)
for (size_t id = 0; id < ARRAYSIZE(WeaponNameList); ++id)
{
const char *weapon = WeaponNameList[id];
const char *weapon = WeaponsList[id].name.chars();
if (weapon[prefix_weapon_length] == '_' && !strncmp(weapon, prefix_weapon, prefix_weapon_length))
{