29.06.2015, 00:35
Quote:
Okay, say you have 10 textdraws. For some reason, your server crashes, shuts down, restarts, whatever - and for some reason, only 4 textdraws get destroyed. When your mode starts up again, it's going to create all 10, this leads to either a) misplaced textdraw ID's or b) multiple textdraws for one ID. Either of these options aren't good, and should be prevented, which destroying them on exit does. As stated above, in programming a common practice is to run clean up code after an operation is finished.
|
I guess its some placebo code, or a code artefact. There shouldnt be a scenario in which you need to "clean up" the textdraws manually on gamemode exit.
Different story for filterscripts though. Properly deleting textdraws in filterscripts is important, especially for filterscripts that are supposed to be stopped/restarted frequently, else it will create the same textdraws again and again.
So deleting textdraws in gamemodes probably comes from that. People just copied over some filterscript textdraws, and also added the cleanup part without further thinking about why they are doing it. Others might then have learned from those gamemodes, and took over that "scripting technique" for textdraws in gamemodes. Not because they need to do it, but because many other people did so before.