Basically you get the error because the compiler does not have the same level of intuition that we do when we look at the code. As far as the compiler is concerned the if/else-if block that sets stf may not actually result in stf being set.
As an aside I would recommend an alternate way of doing this anyway:
* Use a single texture to hold all 6 faces packed together somehow.
* Create a static lookup cubemap that maps the incoming 3D vector to the UV coord of the point in the faces texture.
As long as you use point sampling for both lookups everything should work out OK.
This way not only do you only need to render to one rendertarget for the light instead of 6, but you also replace a whole load of ugly math and sampler array lookup with a texture read which can be a win in some cases.
Hope this helps,
Guess it would help! Mike: You saved me! rating ++... (I can see you're from Sweden as well...)
Why is it that life always seems so much easier in the morning [lol]?