From 5d7cdd5aa54b2a884ef825a26aa8d5e71248350d Mon Sep 17 00:00:00 2001 From: Richard Helgeby Date: Fri, 6 Aug 2010 14:49:38 +0200 Subject: [PATCH] Added array existence check in weapons module. This might fix bug 166. --- src/zr/weapons/weapons.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/zr/weapons/weapons.inc b/src/zr/weapons/weapons.inc index fa00b47..8a00c9a 100644 --- a/src/zr/weapons/weapons.inc +++ b/src/zr/weapons/weapons.inc @@ -482,6 +482,12 @@ stock WeaponsNameToIndex(const String:weapon[]) */ 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]; // Initialize string to null.