Server chrashes after Iter_Remove - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server chrashes after Iter_Remove (
/showthread.php?tid=661414)
Server chrashes after Iter_Remove [SOLVED] -
Gusteakas - 03.12.2018
Hiya,
I've created taxi actors. Whenever the actor's timer has passed, I want to destroy it. I did some debugging, and I can't figure it out what is wrong. After gettime() > TaxiClientTimer is positive, then it should be removed and it prints every single message but server crashes after the printf("Finished %d", i); What can couse the problem? This code is in a timer which ticks every second.
SOLVED: I was using Iter_Remove inside foreach loop. Right thing to do is to use Iter_SafeRemove instead.