I'm playing around with making gaps that warp bullets from one to another, and I've got them working for the most part, though they still need improvement. However, now I'm encountering a strange issue where Danmakufu freezes
after warping shots through the gaps - but not until the single ends.
My guess would be that it has something to do with cleaning up the gaps at the end, but
it still happens when then there aren't any gaps left at the end, and
it doesn't happen if no shots have been warped through gaps.
Gap functions:
https://pastebin.com/YuBEVpnQTest single:
https://pastebin.com/x3ZiGAgQFinalize task:
https://pastebin.com/M1jBXNzfAny ideas?
Edit: It didn't happen when I stopped creating gaps well before the end of the script, so I'm guessing it's to do with them being deleted at the end after all. It's not just something being null unexpectedly, though, since that would throw an exception rather than "th_dnh.exe has stopped working".
Edit2: It only happens when the spell times out, not when the boss is shot down.
Edit3: It still froze when I replaced the "in" gap with an "out" gap, which do nothing on their own, thus preventing any bullets from being warped. (It didn't freeze earlier when I stopped the shots being fired at all, leading me to think it only happened when shots had been warped.)
So now I think it's something to do with the task I was using to fire a "wedge" of shots (like Seiran). I wrote it the other day but hadn't yet actually used it in anything aside from testing (used it here because it's an easy way to check how deformed the pattern gets), so I'm not too surprised I hadn't noticed it yet.
Wedge shot task:
https://pastebin.com/yGUZDFrcEdit4: Found the problem. Turns out it was completely unrelated to the gaps. To make it easier to get a reference to all the shots in a wedge, the wedge task adds each new shot to an array stored in the dictionary of an invisible dummy bullet, which the function returns. The dummy bullet was deleted when the single ended, but the task had just enough time before the script closed to try to add one more row. Since the dummy bullet had been deleted, the script crashed when it tried to use it.
Still not sure why that caused Danmakufu to freeze instead of just throwing an exception, though. Something to do with the script being in the process of ending, maybe?