View Full Version : [AscEmu] Custom TaxiPath without DBC edit
11-13-2015, 10:29 PM
This script is a simple example how to add custom taxi nodes (without dbc edit).
Of course this script can be written in another way, sure, it is just an example (feel free to improve and change this in the way you like).
Working for latest AscEmu WotLK (master repo).
The attachment includes the .diff for core changes and the sql for Mirko (the flightmaster)
I think it was Cromon who showed me the way how to do it (back in the days 2008 maybe)
11-13-2015, 10:52 PM
Calling new without delete looks a bit off. I think it might be a memory leak.
I assume the methods usually use DBC data which is static, so you should probably make static data too instead of calling new all the time.
11-13-2015, 11:04 PM
Isn't it deleted in the destructor of class TaxiPath and/or destructor in class TaxiMgr?
11-13-2015, 11:27 PM
I dont have the source locally and have not browsed through it much.
But looks like TaxiPathNode added to TaxiPath are destroyed when TaxiPath is destroyed.
But the TaxiPath is not destroyed anywhere since TaxiStart seems to assume that the memory management is handled by something else.
So through leaking TaxiPath it is also leaking the TaxiPathNode.
So the created things would be deleted only once the whole program exits, which would also happen if they were stored in taximgr for the lifetime of the mgr since it is a singleton and not per player thing.
Cant say for sure since I am not familiar with how arcemu and ascemu work at all.
Probably best bet would be looking at where the normal TaxiPath are stored at and how. If they are in taximgr or stored somewhere on startup, then the code is leaking as those are created once on startup and this is creating on every click.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.