Foreach saferemove causes infinite loop
#7

Quote:
Originally Posted by m4karow
Посмотреть сообщение
Yeah i know. I could solve in that way, but i dont want to use that method, that's why i'm using foreach. Any advices? :/
Tell me if it's working, i have something like this in my GM and work without any crash/problem.

Код:
foreach(new serveritemid : ServerItems)
	{
		count[serveritemid]++;
		if(count[serveritemid] == 3)
		{
			new next = serveritemid ;
			Iter_SafeRemove(ServerItems, next, serveritemid );
			serveritemid = next;
		}
		if(!Iter_Count(ServerItems))
		{
			printf("ServerItems empty");
		}
		printf("%d", serveritemid);
	}
Reply


Messages In This Thread
Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 14:27
Re: Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 16:22
Re: Foreach saferemove causes infinite loop - by raydx - 01.10.2017, 17:18
Re: Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 17:32
Re: Foreach saferemove causes infinite loop - by Marricio - 01.10.2017, 18:45
Re: Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 19:06
Re: Foreach saferemove causes infinite loop - by None1337 - 01.10.2017, 19:11
Re: Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 19:15
Re: Foreach saferemove causes infinite loop - by None1337 - 01.10.2017, 19:24
Re: Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 19:28

Forum Jump:


Users browsing this thread: 1 Guest(s)