Maximum recursion level?[Edit] in Developer Help
|
|
I've got a simple little bomb in my game that can be fired from one of a few specified aircraft. I'm using Spuzzum's s_missile library(I'd be crazy not to), and I designed the bomb itself as follows:
ATGmissile icon = 'tiles.dmi' icon_state = "ata" Del() for(var/obj/O in view(4,src)) if(O.dontdeleteme) continue del O ..() <dm> But every time I use it, Dream Seeker bellyaches about reaching the maximum recursion level.
runtime error: Maximum recursion level reached (perhaps there is an infinite loop) To avoid this safety check, set world.loop_checks=0. proc name: Del (/obj/Missile/ATGmissile/Del) usr: Mobius Evalon (/mob/characters/mobius) src: ATGmissile (/obj/Missile/ATGmissile) call stack: (Insert spam here)
I really don't want to disable loop_checks(I'm more than confident I'll need it in the future); is there some feature in s_missile I'm overlooking?
[Edit: Heheh, scratch setting loop_checks to zero, it instantly crashes the world and closes Dream Seeker.]
|
|
The problem here is that it is bad coding, because when this 'missile' trys to delete itself, it is going to call that delete loop, which then in turn gets to the missile, and calls the del proc, which calls the loop, which calls the missiles del proc, etc etc, in a never ending cycle.