I'm having a bit of trouble with sswift's shadow system at the moment. However, I have managed to track down what the problem is, and I'd really appreciate it if someone could help me fix the bug.
The bug is, basically, that is crashes on the THIRD time it tries to update the static shadows. I tested it, and yes - the first two times it is okay, but the third it gives errors of "Entity does not exist".
Initially it is "FreeEntity ThisShadow\Mesh" that crashes, whereas if I comment it out, it crashes on "FreeTexture ThisTexture\Texture". If I comment both of them out, then the shadows just get darker and darker each time, as new shadows are created without killing the old ones.
Does anyone have any idea why it would choke on FreeEntity? I even tried this:
It runs the line, and then crashes. Surely this is checking that the entity exists before it tries to free it, so it seems strange that it crashes.
Help?
The bug is, basically, that is crashes on the THIRD time it tries to update the static shadows. I tested it, and yes - the first two times it is okay, but the third it gives errors of "Entity does not exist".
; Delete all the static shadow meshes. For ThisShadow.Static_Shadow = Each Static_Shadow FreeEntity ThisShadow\Mesh Next ; Delete all the static shadow textures. For ThisTexture.Static_Shadow_Texture = Each Static_Shadow_Texture FreeTexture ThisTexture\Texture Next
Initially it is "FreeEntity ThisShadow\Mesh" that crashes, whereas if I comment it out, it crashes on "FreeTexture ThisTexture\Texture". If I comment both of them out, then the shadows just get darker and darker each time, as new shadows are created without killing the old ones.
Does anyone have any idea why it would choke on FreeEntity? I even tried this:
"If ThisShadow\Mesh Then FreeEntity ThisShadow\Mesh"It runs the line, and then crashes. Surely this is checking that the entity exists before it tries to free it, so it seems strange that it crashes.
Help?