Consider following snippet:
static bool:gIsWeaponAllowed[MAX_WEAPONS] = {true, ...};
public OnGameModeInit()
{
for (new i = 0; i < sizeof gIsWeaponAllowed; i++)
{
printf("%d: %d", i, gIsWeaponAllowed[WEAPON:i]);
}
return 1;
}
One would expect that all slots would be initialized to true, but only the first slot gets set.
[2024-07-27T18:24:52Z] [Info] 0: 1
[2024-07-27T18:24:52Z] [Info] 1: 0
[2024-07-27T18:24:52Z] [Info] 2: 0
...
[2024-07-27T18:24:52Z] [Info] 45: 0
[2024-07-27T18:24:52Z] [Info] 46: 0
Adding an additional
#define MAX_WEAPONS (WEAPON:47)
seems to remedy this problem and still allows the array to be indexed properly with the WEAPON_ definitions. This will probably need to be added for all tagged MAX_ definitions.
Consider following snippet:
One would expect that all slots would be initialized to
true, but only the first slot gets set.Adding an additional
seems to remedy this problem and still allows the array to be indexed properly with the
WEAPON_definitions. This will probably need to be added for all taggedMAX_definitions.