Foreach bug?
#2

Sorry for double post.
I think I found (?) Foreach serious bug.
Код:
#include a_samp
#include foreach

new Iterator:test<100>;
public OnFilterScriptInit(){

	Iter_Add(test,5);
	Iter_Add(test,0);
	Iter_Add(test,1);
	Iter_Add(test,2);
	
	foreach( new i : test){
		if( i != 99 ){
			Iter_Remove(test,i);
		}
	}
	return 1;
}
Код:
loadfs x



 =======================================
 |                                     |
 |        YSI version 3.09.0684        |
 |        By Alex "******" Cole        |
 |                                     |
 =======================================

[debug] Run time error 4: "Array index out of bounds"
[debug]  Accessing element at index 101 past array upper bound 100
[debug] AMX backtrace:
[debug] #0 0000220c in public Itter_OnFilterScriptInit () at x.pwn:12
[debug] #1 0000142c in public ScriptInit_OnFilterScriptInit () at D:\GTA\serwerm
ap\include\include\YSI\y_iterate.inc:745
[debug] #2 000000e4 in Debug_Print0 () at D:\GTA\serwermap\include\include\YSI\i
nternal\..\y_scriptinit.inc:132
  Filterscript 'x.amx' loaded.
Reply


Messages In This Thread
Foreach bug? - by RCON1 - 02.08.2013, 14:57
Re: Foreach bug? - by RCON1 - 02.08.2013, 18:29

Forum Jump:


Users browsing this thread: 1 Guest(s)