ID:174103
 
ok lets say Im using a variable to store an obj. That variable is then used to add an overlay to the player. But the variable CAN = null. My question is what EXACTLY does it do when you try to add a null overlay? For instance var/TestObj = null then you use that for an overlay: usr.overlays += usr.TestObj see TestObj = null so basically its saying usr.overlays += null what EXACT does this do? Does it just return and do nothing? Does it add a blank overlay? What?
Aridale wrote:
ok lets say Im using a variable to store an obj. That variable is then used to add an overlay to the player. But the variable CAN = null. My question is what EXACTLY does it do when you try to add a null overlay? For instance var/TestObj = null then you use that for an overlay: usr.overlays += usr.TestObj see TestObj = null so basically its saying usr.overlays += null what EXACT does this do? Does it just return and do nothing? Does it add a blank overlay? What?

I'm not sure if it returns nothing or adds a blank overlay, but why don't you just do this?
if(src.TestObj) src.overlays+=src.TestObj


That should take care of it.

~>Volte
In response to Volte
thats actually why I was wonderin Volte was to know if I NEED to add those checks or not.
In response to Aridale
What's the problem with doing the checks? It'd make sure nothing weird happened with the overlays, and it's not like it'd slow it down much.