| 05-02-2007, 06:05 PM | #1 |
Hi, I'm new to Jass and when I analyse some of your code examples I always see something like this: Code:
call FlushGameCache(InitGameCache("GC"))
set udg_GC=InitGameCache("GC")Why not simply initialize it once? |
| 05-02-2007, 06:44 PM | #2 |
If your map was multiplayer guaranteed that wouldn't be an issue. But we also might use test map for quick tests so it is better to do that. Why? The problem is that When a gamecache is saved the game somehow thinks it is a good idea to save ALL GAMECACHES . Even these ones we use for spell and system storage rather than for saving stuff in disk for the player. Then if one of these dummy gamecaches is saved it will be automatically loaded by InitGameCache. So it is better than when initializing it you Flush it (aka clear it) But then Flush also discards the gamecache handle, so you have to call InitGameCache again. (this time it 'll be empty) |
| 05-02-2007, 07:09 PM | #3 |
OK I got it. Thank you. There is one more thing i want to ask: Code:
set gcOne = InitGameCache("GC")
set gcTwo = InitGameCache("GC") |
