[Crash Detect Errors] Array bounds..
#2

Solution: Change the <= to < in the loop.

Explanation:
Say MAX_PLAYERS is 10, player IDs range from 0 to 9, and <= means less than or equal to, meaning it will call it for ID 10, even though ID 10 can't exist. If you have this array:

pawn Код:
new someArray[MAX_PLAYERS];
Calling someArray[10] will cause an OOB error, as the max index is 9 (don't forget things start at 0).
Reply


Messages In This Thread
[Crash Detect Errors] Array bounds.. - by AdamCooper - 18.07.2013, 01:21
Re: [Crash Detect Errors] Array bounds.. - by MP2 - 18.07.2013, 01:22
Re: [Crash Detect Errors] Array bounds.. - by AdamCooper - 18.07.2013, 02:35
Re: [Crash Detect Errors] Array bounds.. - by AdamCooper - 18.07.2013, 02:38
Re: [Crash Detect Errors] Array bounds.. - by [HiC]TheKiller - 18.07.2013, 05:29
Re: [Crash Detect Errors] Array bounds.. - by AdamCooper - 18.07.2013, 09:07

Forum Jump:


Users browsing this thread: 1 Guest(s)