Added array existence check in weapons module. This might fix bug 166.
This commit is contained in:
parent
3f68eaa2f0
commit
5d7cdd5aa5
@ -482,6 +482,12 @@ stock WeaponsNameToIndex(const String:weapon[])
|
|||||||
*/
|
*/
|
||||||
stock WeaponsEntityToDisplay(const String:entityname[], String:display[], displaymaxlen, noprefix = false)
|
stock WeaponsEntityToDisplay(const String:entityname[], String:display[], displaymaxlen, noprefix = false)
|
||||||
{
|
{
|
||||||
|
// Check if weapon data is loaded.
|
||||||
|
if (arrayWeapons == INVALID_HANDLE)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
decl String:weaponentity[WEAPONS_MAX_LENGTH];
|
decl String:weaponentity[WEAPONS_MAX_LENGTH];
|
||||||
|
|
||||||
// Initialize string to null.
|
// Initialize string to null.
|
||||||
|
Loading…
Reference in New Issue
Block a user