DOWNTIME ANNOUNCEMENT - Maintenance will be performed from 1AM-3AM Pacific Time on 2010-03-20 (tonight). Please do not edit any pages during this time.

Looking for Viewer 2 Beta help? Right this way!

Talk:LlGetSunDirection

From Second Life Wiki

Second Life Wiki > LlGetSunDirection > Talk: LlGetSunDirection
Jump to: navigation, search

In the first example to "quickly determine whether it is day or night" you see the first line read as :

integer lightsOn = -1;//not TRUE or FALSE

I think its a very bad idea to label -1 as FALSE in capital in the comment, since FALSE is 0 in LSL and in most if not all programming languages

the comment should simply read "// assume lights off on start", this would be clear and wouldn't require any modification to the code

--Francoise Eichel 04:40, 14 May 2009 (UTC)

lightsOn isn't labeled as nor is it FALSE, it is labeled as being neither TRUE or FALSE. When the code runs, -1 won't match either the TRUE or FALSE value from the elevation test; which will result in it setting the fullbright attributes of the faces. Your proposed change of comment does not match how the code works. I think you are confused by the mix of Boolean keywords with integer types, LSL doesn't have a dedicated Boolean type and does not have Boolean compares, it uses integer compares instead (which is what the code exploits). -- Strife (talk|contribs) 10:30, 14 May 2009 (UTC)
Personal tools