| 07-01-2006, 04:05 AM | #2 |
You don't set an integer to null, you set it to 0. |
| 07-01-2006, 04:09 AM | #3 |
...oh... thx didn't know that. Now I feel stupid. I've just started learning JASS and locals and nulls, so I'm used to setting to null not 0. Thanks again. |
| 07-01-2006, 04:11 AM | #4 |
You are welcome. On that note, you set to null anything that is based off handle (that is, units, regions, etc). |
| 07-01-2006, 04:15 AM | #5 |
ahh, and anything with numbers to zero (integers, reals, and any others that I don't know) Like I said, I was so used to using null it just came naturally for me. Thanks again, saves fine now. |
| 07-01-2006, 04:17 AM | #6 |
Yeah, I get what you mean. Hopeuflly you won't let such a slip happen again ;P |
| 07-01-2006, 04:36 AM | #7 |
Well now that I know what to do, I'll probably forget and do it again, lol. But I'll at least try to remeber. Darn, I'm upset now. I just tested the spell and one part doesn't work, but thats okay becuase I know exactly what to do to fix it. (I think I left out a trigger somewhere... Hmmm...) |
| 07-01-2006, 07:00 AM | #8 |
There is no need to nullify things which do not extend a handle. Players also apparently do not need to be nullified. Integers, reals, etc. do not require nullification, setting to 0, or anything. |
| 07-01-2006, 07:53 AM | #9 |
Only locals in the function that are not: Integer, real, string, code or boolean need to be nullified. Even less than that, you really null the things you are not going to use anymore, with common things like locations, units etc. |
| 07-01-2006, 10:21 AM | #10 |
you cant have code variables. Also, i've heard that all handles need to always be nullified, also players. Their handle index doesnt need to be recycled, but still the pointer will otherwise stay in memory too, creating a really small leak. (so i've heard that is) |
| 07-01-2006, 11:00 AM | #11 |
No, you can have code variables. No, it only leaks when you deallocate. No deallocation no leak. But don't take my word for it... |
| 07-01-2006, 11:12 AM | #12 | |
Quote:
JASS:local code c = function DoNothing Erm, yes you can. |
| 07-01-2006, 11:19 AM | #13 |
What the hell, since when does that compile... Gonna do some more testing, since really, before it didnt compile. But ye, you appear to be right, my bad. |
| 07-01-2006, 03:39 PM | #14 |
Okay, i DO need to set the integer to 0, becuase if I don't then it may be set to 3, which means a player who only had the spell at level 1 would get it at level 3 instead. |
| 07-01-2006, 05:54 PM | #15 |
You may need to set a global integer to 0 if you are going to use it again or something. But a local at the end of the trigger dosent need to be set to 0, it means nothing. |
