![Old](images/statusicon/post_old.gif)
01-05-2009, 04:56 PM
|
Psionic Youth
|
![Tyhm's Avatar](image.php?u=46&dateline=1239446145) |
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
|
|
discard #varname#;
A minor item for further cranking up the efficiency of complex NPCs. Limits the scope of a variable by declaring it will no longer be used. For instance:
for(this.i=0;this.i<playerscount;this.i++){
...
}
discard this.i; //implicit
because you're unlikely to care that this.i still =playerscount an hour later. Would avoid the usual scripting mess of having one NPC with 70 variables, all of which were intended to be temporary but are still holding floating-point data; granted, that's only 70bytes, but it adds up. |
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."
"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
![](http://www.livejournal.com/userpic/35788192/8456105) - My pet, the Levelup Gnome
http://forums.graalonline.com/forums...&postcount=233
|
|
|