Quote:
Originally Posted by lerxst2112
xtmp doesn't appear to be used at all, and none of those allocations should be done with new since they are fixed size. Since there are multiple returns in the function it'd be a pain to try and figure out which of them need to be deleted before each return but if they are created on the stack it's automatically handled.
You only need one buffer to construct all of the strings you send to the client, there's no reason to allocate one, use it once, then allocate another one the next time you need to construct a message. The sizes are also rather random, 100, 250, 1000 when you can be pretty sure what the upper bound is since the only argument is the name of the spell and that has a maximum size.
|
Thanks! I have updated the original code to fix some of these issues. Apparently become a little too dependent on my GarbageCollector in C#
As of this morning I have also added functionality to allow you to specify target as a 3rd argument which will have the spell casted on your current target (defaults to you if no target).
Also, if you perform this command with one of your ungrouped bots targetted, it will also search their spellbook and use that bot if found. This allows commanding of "buff bots" outside of your group of bots.